fix: don't flush env between requests by AlliBalliBaba · Pull Request #1814 · php/frankenphp
This is an alternative to #1799 that instead doesn't flush the $_ENV global at all. I realized that the 'default' state of globals is just a bunch of 0 bits. I also realized that worker mode currently doesn't support $_REQUEST.
cc @withinboredom can you check if this also fixes the segfaults you have been seeing?
I just now also realized that it's not even necessary to flush globals. Their re-import will flush them anyways.
Only $_FILES needs to be flushed or it will segfault, still curious why.
Also surprised that noone has so far complained about $_REQUEST not being supported in worker mode. It will only work if it's jit is disabled.
Alright, I think I finally figured out a cleaner way to reset globals.
Insterestingly, only $FILES will not be flushed on import, all other globals are flushed.
see: $_GET $_POST $_COOKIE $_SERVER $_ENV $_FILES $_REQUEST
I think it might make sense to document that $_REQUEST is only supported in worker mode if auto_globals_jit = Off (unrelated to this PR).
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Is it ready to be merged?
Nvm, rather it looks like the phpheaders_test (#1823) will still randomly fail builds so I moved it back to frankenphp_test (probably will report this one to go)
dunglas
deleted the
fix/dont-flush-env-between-requests
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters