In worker mode, $_REQUEST is incorrectly cached
What happened?
Laravel Octance Configure the following a simple routes in Laravel:
Route::get('/test', function () {
$foo = $_REQUEST['foo'] ?? 'null';
return $foo;
});
The php.ini item: auto_globals_jit = On // Default Configuration
1、Go to http://127.0.0.1:8000/test?foo=test1 //echo test1 2、Go to http://127.0.0.1:8000/test?foo=test2 //echo test1
But $_GET/$_POST is work.
When php.ini: auto_globals_jit = Off
1、Go to http://127.0.0.1:8000/test?foo=test1 //echo test1 2、Go to http://127.0.0.1:8000/test?foo=test2 //echo test2
$_REQUEST is work.
Build Type
Docker (Debian Bookworm)
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
auto_globals_jit = On
Relevant log output
Yes, $_REQUEST is currently not supported in worker mode. It only works with auto_globals_jit disabled. Probably makes sense to document this.
Enabling it by default would add an overhead (and apparently not many people are using it).
I believe this is due to bypassing filters? I can't remember, but I'll check when I rebase #1658
No this was always the case. Only $_SERVER is explicitly reloaded
不,一直都是这样。只有 $_SERVER 被明确重新加载
Are there any other situations that are inconsistent with the classic mode? Can these differences be supplemented in the document? After all, these are not prohibited in PHP src, and any kind of code in reality can appear. As an ordinary developer, I am refactoring old projects and preparing to apply Frankenphp to production environments. These unknown information have raised some concerns for our team about this new technology
IMHO we should consider this a bug and fix it, even if there is a small performance penalty. Maybe can we provide an option to opt-out, but compatibility with normal PHP is key.
@phenixsoul I would say this is probably a bug/oversight as this appears to be the first time it is reported -- so, like @AlliBalliBaba mentioned, it doesn't appear to be used often.