mirror of
https://github.com/php/frankenphp.git
synced 2026-03-24 00:52:11 +01:00
Hi, This PR fixes #1931, it handles $_REQUEST in worker mode correctly when `auto_globals_jit` is enabled (default configuration for PHP). Some concerns were raised in the comments of the issue regarding performance. This implementation should make sure that request is created only if used. However if a previous execution plan already used `_REQUEST`, all subsequent requests will create it. So the concern is "kindof" mitigated. Let me know if you have any suggestion to improve this. --------- Signed-off-by: Xavier Leune <xavier.leune@gmail.com> Co-authored-by: Alexander Stecher <45872305+AlliBalliBaba@users.noreply.github.com>
17 lines
484 B
PHP
17 lines
484 B
PHP
<?php
|
|
|
|
require_once __DIR__.'/_executor.php';
|
|
|
|
return function () {
|
|
// Only access $_REQUEST on requests where use_request=1 is passed
|
|
// This tests the "re-arm" scenario where $_REQUEST might be accessed
|
|
// for the first time during a later request
|
|
if (isset($_GET['use_request']) && $_GET['use_request'] === '1') {
|
|
include 'request-superglobal-conditional-include.php';
|
|
} else {
|
|
echo "SKIPPED";
|
|
}
|
|
echo "\nGET:";
|
|
var_export($_GET);
|
|
};
|