more PHP 5.4 backports