zendtech / ZendOptimizerPlus

Other
914 stars 142 forks source link

Harmonization of PECL ZendOptimizerPlus and ext/opcache codebase for PHP-5.6 #157

Closed TerryE closed 10 years ago

TerryE commented 10 years ago

I've just done this myself because I want to test developments on both the PECL and core packages. One specific note is that TSRM/tsrm_virtual_cwd.h has been renamed zend_virtual_cwd.h in PHP-5.6, which makes a lot of sense since this module is also used in non-ZTS builds. However ZendAccelerator.c and zend_accelerator_module.c need extra #ifdef logic to handle this:

#if ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO
#include "zend_virtual_cwd.h"
#else
#include "TSRM/tsrm_virtual_cwd.h"
#endif

This change should also be added to the ext/opcache versions since there is no point in letting the two source trees diverge.

I've also noted that some of the recent changes which are truly PHP-5.6-specific, e.g. the introduction of GC(interned_empty_string) are not predicated on an #if ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO test and will therefore fail if built against PHP-5.5 or earlier.

The other one that I've noted in the unguarded use of opline->opcode == ZEND_RECV_VARIADIC in Optimizer/block_pass.c.

TerryE commented 10 years ago

I've added this patch as https://bugs.php.net/bug.php?id=66471