Bug #79875 [NEW]: getenv() can't get the right binary string passed by putenv()

From: Date: Sat, 18 Jul 2020 17:02:04 +0000
Subject: Bug #79875 [NEW]: getenv() can't get the right binary string passed by putenv()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228113@lists.php.net to get a copy of this message
From: paulbalandan at gmail dot com Operating system: Windows 10 PHP version: 7.4.8 Package: *General Issues Bug Type: Bug Bug description:getenv() can't get the right binary string passed by putenv() Description: ------------ In Windows when posting binary string to the environment via putenv and then getting it back via getenv, the results are different. Test script: --------------- <?php $bin = hex2bin('f699c7fd18a8e082d0228932f3acd40e1ef5ef92efcedda32842a211d62f0aa6'); putenv("key=$bin"); $bin2 = getenv('key', true); var_dump(bin2hex($bin) === bin2hex($bin2)); Expected result: ---------------- bool(true) Actual result: -------------- bool(false) -- Edit bug report at https://bugs.php.net/bug.php?id=79875&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79875&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79875&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79875&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79875&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79875&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79875&r=support Expected behavior: https://bugs.php.net/fix.php?id=79875&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79875&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79875&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79875&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79875&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79875&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79875&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79875&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79875&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79875&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79875&r=mysqlcfg

« previous php.bugs (#228113) next »