Bug #76284 [Fbk->NoF]: auto_globals_jit doesn't detect all types of superglobal use

From: Date: Sun, 24 Jun 2018 04:25:46 +0000
Subject: Bug #76284 [Fbk->NoF]: auto_globals_jit doesn't detect all types of superglobal use
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215937@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76284&edit=1 ID: 76284 Updated by: php-bugs@lists.php.net Reported by: jocrutrisi at ibsats dot com Summary: auto_globals_jit doesn't detect all types of superglobal use -Status: Feedback +Status: No Feedback Type: Bug Package: Scripting Engine problem Operating System: Linux PHP Version: 7.2.5 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2018-05-03 20:04:20] jocrutrisi at ibsats dot com Hello, the samples I posted above are sufficient to reproduce the problems for me. I just enable auto_globals_jit, make sure error reporting (and optionally error display) are on, and then: <?php $foo = $_ENV; ?> This will produce: <br /> <b>Notice</b>: Undefined variable: _ENV in <b>[...][...]</b> on line <b>2</b><br /> If you can't reproduce this, we might need to narrow down the situation. I only have access to 7.2.4 right now, BTW, but this wasn't available in the drop-down with versions, so I had to specify 7.2.5, seeing as the list of fixes contains nothing relevant. ------------------------------------------------------------------------ [2018-04-29 04:59:50] requinix@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Works for me, and that exact code you posted won't do the job anyways. The repro script has to be precise, not some summarized version of your tests. ------------------------------------------------------------------------ [2018-04-28 22:38:29] jocrutrisi at ibsats dot com 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 this bug report at https://bugs.php.net/bug.php?id=76284&edit=1

« previous php.bugs (#215937) next »