diff --git a/NEWS b/NEWS index 675ac03745659..ea08065ce01e3 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ PHP NEWS - CLI: . Extended --ini to print INI settings changed from the builtin default. (timwolla) + . Drop support for -z CLI/CGI flag. (nielsdos) - COM: . Fixed property access of PHP objects wrapped in variant. (cmb) diff --git a/UPGRADING b/UPGRADING index 6b4f6c335843a..ab034f7f684b1 100644 --- a/UPGRADING +++ b/UPGRADING @@ -362,9 +362,13 @@ PHP 8.5 UPGRADE NOTES ======================================== - Core: - The high resolution timer (`hrtime()`) on macOS now uses the recommended - `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` API instead of - `mach_absolute_time()`. + . The high resolution timer (`hrtime()`) on macOS now uses the recommended + `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` API instead of + `mach_absolute_time()`. + +- CLI/CGI: + . The `-z` or `--zend-extension` option has been removed as it was + non-functional. Use `-d zend_extension=` instead. ======================================== 14. Performance Improvements diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 3ec469382cad9..e3f87ee1e1636 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -697,6 +697,15 @@ void * zend_test_custom_realloc(void * ptr, size_t len ZEND_FILE_LINE_DC ZEND_FI return _zend_mm_realloc(ZT_G(zend_orig_heap), ptr, len ZEND_FILE_LINE_EMPTY_CC ZEND_FILE_LINE_EMPTY_CC); } +static void zend_test_reset_heap(zend_zend_test_globals *zend_test_globals) +{ + if (zend_test_globals->zend_test_heap) { + free(zend_test_globals->zend_test_heap); + zend_test_globals->zend_test_heap = NULL; + zend_mm_set_heap(zend_test_globals->zend_orig_heap); + } +} + static PHP_INI_MH(OnUpdateZendTestObserveOplineInZendMM) { if (new_value == NULL) { @@ -718,10 +727,8 @@ static PHP_INI_MH(OnUpdateZendTestObserveOplineInZendMM) ); ZT_G(zend_orig_heap) = zend_mm_get_heap(); zend_mm_set_heap(ZT_G(zend_test_heap)); - } else if (ZT_G(zend_test_heap)) { - free(ZT_G(zend_test_heap)); - ZT_G(zend_test_heap) = NULL; - zend_mm_set_heap(ZT_G(zend_orig_heap)); + } else { + zend_test_reset_heap(ZEND_MODULE_GLOBALS_BULK(zend_test)); } return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage); } @@ -1387,6 +1394,7 @@ static PHP_GINIT_FUNCTION(zend_test) static PHP_GSHUTDOWN_FUNCTION(zend_test) { zend_test_observer_gshutdown(zend_test_globals); + zend_test_reset_heap(zend_test_globals); } PHP_MINFO_FUNCTION(zend_test) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 5ede45e766674..392a95d25ea3b 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -158,7 +158,6 @@ static const opt_struct OPTIONS[] = { {'w', 0, "strip"}, {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ {'v', 0, "version"}, - {'z', 1, "zend-extension"}, {'T', 1, "timing"}, {'-', 0, NULL} /* end of args */ }; @@ -1042,7 +1041,6 @@ static void php_cgi_usage(char *argv0) " -s Display colour syntax highlighted source.\n" " -v Version number\n" " -w Display source with stripped comments and whitespace.\n" - " -z Load Zend extension .\n" " -T Measure execution time of script repeated times.\n", prog, prog); } @@ -2383,10 +2381,6 @@ consult the installation file that came with this distribution, or visit \n\ behavior = PHP_MODE_STRIP; break; - case 'z': /* load extension file */ - zend_load_extension(php_optarg); - break; - default: break; } diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in index e8ac382402d23..797ef3242b6a3 100644 --- a/sapi/cli/php.1.in +++ b/sapi/cli/php.1.in @@ -303,13 +303,6 @@ Version number .PD 1 .B \-w Output source with stripped comments and whitespace -.TP -.PD 0 -.B \-\-zend\-extension \fIfile\fP -.TP -.PD 1 -.B \-z \fIfile\fP -Load Zend extension .IR file .TP .IR args.\|.\|. diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index ad2c8d1572715..55246cf96c91d 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -148,7 +148,6 @@ const opt_struct OPTIONS[] = { {'w', 0, "strip"}, {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ {'v', 0, "version"}, - {'z', 1, "zend-extension"}, {10, 1, "rf"}, {10, 1, "rfunction"}, {11, 1, "rc"}, @@ -496,7 +495,6 @@ static void php_cli_usage(char *argv0) " -s Output HTML syntax highlighted source.\n" " -v Version number\n" " -w Output source with stripped comments and whitespace.\n" - " -z Load Zend extension .\n" "\n" " args... Arguments passed to script. Use -- args when first argument\n" " starts with - or script is read from stdin\n" @@ -800,9 +798,6 @@ static int do_cli(int argc, char **argv) /* {{{ */ context.mode = PHP_CLI_MODE_STRIP; break; - case 'z': /* load extension file */ - zend_load_extension(php_optarg); - break; case 'H': hide_argv = true; break;