|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2010-01-08 07:02 UTC] jani@php.net
  [2010-01-16 01:00 UTC] php-bugs at lists dot php dot net
  [2010-01-23 01:08 UTC] v-ryanbi at microsoft dot com
  [2010-01-24 13:49 UTC] svn@php.net
  [2010-01-24 14:29 UTC] pajoye@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 11:00:01 2025 UTC | 
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)