Fix destruction order in zend_shutdown (bug #65463, #66036)

If Apache or a similar SAPI receives a signal during PHP processing
it calls zend_shutdown() without calling shutdown_executor().
	#65463: If a module like Gearman or Memcached is loaded,
in the unfixed version it is unloaded by zend_destroy_modules() before the
CG(CLASS_TABLE) is destructed. When CG(CLASS_TABLE) is destructed,
any pointers to methods (specifically around destruction) in the unloaded
module's .so are now dangling and the process segfaults.
	#66036: Any subclasses of an internal class like ArrayObject need
to be destructed in order: subclass first and then the internal class. In the
unfixed version zend_shutdown() clears the CG(CLASS_TABLE) from the head
of the list onwards, so internal classes are destructed first and user-defined
classes last. Internal classes are alloc/deallocated with malloc/free while
user-defined classes with emalloc/efree. If there's shared data between them
then efree() could be called instead of free() leading to a seg-fault.
Fix typo from commit 32314f6b6
Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
Refactored optimizer (compile different opimizer passes separately, instead of including *.c file)
Use better hash functions
solve conflicting type size_t vs int
remove duplicate condition already present a line upper
fix format
fix incompatible pointer
rename misleading define
fix phar copy-on-write
Merge branch 'master' of git.php.net:php-src

# By Popa Adrian Marius
# Via Popa Adrian Marius
* 'master' of git.php.net:php-src:
  rename misleading define
Duplicate array only if neccessary
replace llabs with imaxabs

both are gcc built-in but imaxabs doesn't require C99 compat (see man)
make array/object APIs accept large strings as values of elements/props
fixed strip_tags() and hebrev() to work with big strings
fixed trim() and strtok() to work with big strings
skip this if we can't check the uid
Special-case aliases, add warning comments to implementations
Fix bug #67922