diff --git a/NEWS b/NEWS index d41711a82e0..533617e7995 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ PHP NEWS - Core: . Fixed bug GH-15712: zend_strtod overflow with precision INI set on large value. (David Carlier) + . Fixed bug GH-15905 (Assertion failure for TRACK_VARS_SERVER). (cmb) - Date: . Fixed bug GH-15582: Crash when not calling parent constructor of diff --git a/main/php_variables.c b/main/php_variables.c index eb442c3d2f9..bac5b1b673b 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -897,6 +897,7 @@ static bool php_auto_globals_create_server(zend_string *name) } else { zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_SERVER]); array_init(&PG(http_globals)[TRACK_VARS_SERVER]); + zend_hash_real_init_mixed(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])); } check_http_proxy(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])); diff --git a/tests/basic/gh15905.phpt b/tests/basic/gh15905.phpt new file mode 100644 index 00000000000..6636b970242 --- /dev/null +++ b/tests/basic/gh15905.phpt @@ -0,0 +1,12 @@ +--TEST-- +GH-15905 (Assertion failure for TRACK_VARS_SERVER) +--INI-- +variables_order=E +auto_globals_jit=0 +register_argc_argv=1 +--FILE-- + +--EXPECT-- +okay