Bug #79254 [NEW]: CLI: getenv() w/o arguments not showing changes

From: Date: Mon, 10 Feb 2020 14:35:22 +0000
Subject: Bug #79254 [NEW]: CLI: getenv() w/o arguments not showing changes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225478@lists.php.net to get a copy of this message
From: franz dot zieris at gmail dot com Operating system: Windows PHP version: 7.4.2 Package: PHP options/info functions Bug Type: Bug Bug description:CLI: getenv() w/o arguments not showing changes Description: ------------ Calling getenv() without an argument does not reflect change made with putenv, but calling getenv() on a concrete variable *does*. The test script below produces the expected output on a Linux machine, but on my Windows machine the array difference is "array(0) { }". I'm using the out-of-the box configuration of php.ini-development. These are the first lines of php -i System => Windows NT MYPC 10.0 build 18363 (Windows 10) AMD64 Build Date => Jan 21 2020 17:46:05 Compiler => Visual C++ 2017 Architecture => x64 Configure Command => cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-pdo-oci=c:\php-snap-build\deps_aux\oracle\x64\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-snap-build\deps_aux\oracle\x64\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--without-analyzer" "--with-pgo" Server API => Command Line Interface Virtual Directory Support => enabled Configuration File (php.ini) Path => C:\WINDOWS Loaded Configuration File => C:\xampp\php\php.ini Scan this dir for additional .ini files => (none) Additional .ini files parsed => (none) PHP API => 20190902 PHP Extension => 20190902 Zend Extension => 320190902 Zend Extension Build => API320190902,TS,VC15 PHP Extension Build => API20190902,TS,VC15 Debug Build => no Thread Safety => enabled Thread API => Windows Threads Zend Signal Handling => disabled Zend Memory Manager => enabled Zend Multibyte Support => disabled IPv6 Support => enabled DTrace Support => disabled Test script: --------------- <?php $old = getenv(); var_dump(getenv("FOO", true)); // expected: bool(false) putenv("FOO=BAR"); $new = getenv(); var_dump(array_diff($new, $old)); // expected: array(1){["FOO"]=>string(3) "BAR"} var_dump(getenv("FOO", true)); // expected: string(3) "BAR" ?> Expected result: ---------------- bool(false) array(1) { ["FOO"]=> string(3) "BAR" } string(3) "BAR" Actual result: -------------- bool(false) array(0) { } string(3) "BAR" -- Edit bug report at https://bugs.php.net/bug.php?id=79254&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79254&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79254&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79254&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79254&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79254&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79254&r=support Expected behavior: https://bugs.php.net/fix.php?id=79254&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79254&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79254&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79254&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79254&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79254&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79254&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79254&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79254&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79254&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79254&r=mysqlcfg

« previous php.bugs (#225478) next »