Skip to content

Commit b07bc62

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: ensure test passes with prod config Fix CGI with auto_globals_jit=0
2 parents 393417f + 2f4b8e6 commit b07bc62

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ PHP NEWS
1818
. Fixed bug GH-19480 (error_log php.ini cannot be unset when open_basedir is
1919
configured). (nielsdos)
2020
. Fixed bug GH-20002 (Broken build on *BSD with MSAN). (outtersg)
21+
. Fixed bug GH-19934 (CGI with auto_globals_jit=0 causes uouv). (ilutov)
2122

2223
- CLI:
2324
. Fix useless "Failed to poll event" error logs due to EAGAIN in CLI server

Zend/zend_compile.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,12 +2023,12 @@ ZEND_API void zend_activate_auto_globals(void) /* {{{ */
20232023
zend_auto_global *auto_global;
20242024

20252025
ZEND_HASH_MAP_FOREACH_PTR(CG(auto_globals), auto_global) {
2026-
if (auto_global->jit) {
2027-
auto_global->armed = 1;
2028-
} else if (auto_global->auto_global_callback) {
2026+
auto_global->armed = auto_global->jit || auto_global->auto_global_callback;
2027+
} ZEND_HASH_FOREACH_END();
2028+
2029+
ZEND_HASH_MAP_FOREACH_PTR(CG(auto_globals), auto_global) {
2030+
if (auto_global->armed && !auto_global->jit) {
20292031
auto_global->armed = auto_global->auto_global_callback(auto_global->name);
2030-
} else {
2031-
auto_global->armed = 0;
20322032
}
20332033
} ZEND_HASH_FOREACH_END();
20342034
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
CGI with auto_globals_jit=0
3+
--INI--
4+
auto_globals_jit=0
5+
variables_order="EGPCS"
6+
--CGI--
7+
--ENV--
8+
FOO=BAR
9+
--FILE--
10+
<?php
11+
var_dump($_SERVER['FOO']);
12+
var_dump($_ENV['FOO']);
13+
var_dump(getenv('FOO'));
14+
?>
15+
--EXPECT--
16+
string(3) "BAR"
17+
string(3) "BAR"
18+
string(3) "BAR"

0 commit comments

Comments
 (0)