From: php at keithtyler dot com Operating system: Windows XP PHP version: 5.3.1 PHP Bug Type: PHP options/info functions Bug description: putenv() does not assign values to env. vars when the value is one character
Description: ------------ In PHP 5.3.1, a putenv() call with a one character value does not assign the value to the variable -- however it does create the variable. It doesn't matter what type of character it is (alpha, numeric, or other). A workaround is to add a space character before or after the value, e.g.: putenv("bar= x"); putenv("bar=x "); (...as long as this space does not cause problems for the consumers of the variable as it will be part of the string value.) Reproduce code: --------------- <?php putenv("foo=ab"); putenv("bar=c"); var_dump(getenv("foo")); var_dump(getenv("bar")); var_dump(getenv("thisvardoesnotexist")); ?> Expected result: ---------------- We would expect the output to be: string(2) "ab" string(1) "c" bool(false) which it does under PHP 5.3.0. Actual result: -------------- string(2) "ab" string(0) "" bool(false) -- Edit bug report at http://bugs.php.net/?id=50690&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50690&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50690&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50690&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50690&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50690&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50690&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50690&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50690&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50690&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50690&r=support Expected behavior: http://bugs.php.net/fix.php?id=50690&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50690&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50690&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50690&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50690&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50690&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50690&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50690&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50690&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50690&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50690&r=mysqlcfg