Code fixes for PHP 5.6-dev and 5.7-dev

(cherry picked from commit 105dee3cd5adc421cd3d60584233326d692f78d2)
Regenerated build/