Fixed bug #66471 (Keep backward compatibility)
Merge branch 'PHP-5.6'

* PHP-5.6:
  Fixed bug #66471 (Keep backward compatibility)
Merge branch 'master' of git.php.net:php-src

* 'master' of git.php.net:php-src:
  move common code into a function