Bug #76284 [NEW]: auto_globals_jit doesn't detect all types of superglobal use

From: Date: Sat, 28 Apr 2018 22:38:31 +0000
Subject: Bug #76284 [NEW]: auto_globals_jit doesn't detect all types of superglobal use
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214974@lists.php.net to get a copy of this message
From: jocrutrisi at ibsats dot com Operating system: Linux PHP version: 7.2.5 Package: PHP options/info functions Bug Type: Bug Bug description:auto_globals_jit doesn't detect all types of superglobal use Description: ------------ I was unexpectedly bit by "$_ENV undefined" notice when using auto_globals_jit. Apparently PHP is very specific about what is considered a superglobal use and what isn't. See examples below. Test script: --------------- // This is considered $_ENV use. $foo = $_ENV['foo']; // This is considered $_ENV use. foreach ($_ENV as $k => $v); // BUG: This is NOT considered $_ENV use (so I get a notice here that $_ENV is undefined) $foo = $_ENV; // BUG: Another example of the same problem (I get a notice $_ENV is undefined) function foo() { return ['env' => $_ENV]; } foo(); Expected result: ---------------- I expect JIT should work transparently. Any mention of $_ENV must cause $_ENV to get defined as if it always was. The exceptions are rather odd, it's unclear why detection of use is not fully comprehensive. Actual result: -------------- Notice of undefined $_ENV. -- Edit bug report at https://bugs.php.net/bug.php?id=76284&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76284&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76284&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76284&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76284&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76284&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76284&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76284&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76284&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76284&r=support Expected behavior: https://bugs.php.net/fix.php?id=76284&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76284&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76284&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76284&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76284&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76284&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76284&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76284&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76284&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76284&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76284&r=mysqlcfg

« previous php.bugs (#214974) next »