|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-08-06 21:48 UTC] m dot kurzyna at crystalpoint dot pl
Description:
------------
This is very similar to #44779, however my report regards variables set as environment variables when running CLI.
A variable is visible in $_SERVER but INPUT_SERVER returns NULL. Setting via SetEnv in apache and when running as mod_php is fine.
Reproduce code:
---------------
<?php
var_dump(
filter_input(INPUT_SERVER,'ENV_NAME',FILTER_SANITIZE_STRING),
$_SERVER['ENV_NAME']
);
?>
Expected result:
----------------
$ ENV_NAME=var php /tmp/t.php
string(3) "var"
string(3) "var"
Actual result:
--------------
$ ENV_NAME=var php /tmp/t.php
NULL
string(3) "var"
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 04:00:01 2025 UTC |
Still a valid bug in 5.6.30 : bash-4.3$ ./php-5.6.30_SunOS5.10_sparcv9.001/sapi/cli/php --version PHP 5.6.30 (cli) (built: Jan 23 2017 01:16:31) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies bash-4.3$ cat foo_var_dump.php <?php var_dump( filter_input(INPUT_SERVER,'SOME_ENV_NAME', FILTER_SANITIZE_STRING), $_SERVER['SOME_ENV_NAME'] ); ?> bash-4.3$ SOME_ENV_NAME=this_stuff ./php-5.6.30_SunOS5.10_sparcv9.001/sapi/cli/php foo_var_dump.php NULL string(10) "this_stuff" It may be worth running a trace through the calls and I did build with full debug sysmbols so this is possible. At least on Solaris.