|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-12-20 13:18 UTC] adam at lavoaster dot co dot uk
Description: ------------ This came out of looking into an issue here - https://github.com/symfony/symfony/issues/25511 If $_SERVER['argv'] exists anywhere in the code, it doesn't matter if it isn't called, just as long it's included, it will add 'argv' and 'argc' to the return of 'getenv()' when called without any parameters. Just a note: If you have xdebug installed, this issue will not present itself. Test script: --------------- <?php var_dump(getenv()); function notcalled() { $_SERVER['argv']; } Expected result: ---------------- It shouldn't return 'argv' or 'argc' in the return array, especially as 'argv' is an array which would break scripts that would directly use getenv(), like Symfony process did, straight into proc_open. Actual result: -------------- It returns 'argv' and 'argc' in the returning array. PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
I haven't been able to reproduce with the CLI or the embedded server. Which SAPIs? (Apache module, FastCGI, etc.) Does it happen if you reference $_SERVER at all and not just with ['argv'], as in function notcalled() { $_SERVER; }