PHP 5.5.13: apply 2 upstream fix