Bug #72904 [Opn->Ver]: proc_open drops hyphenated environment variables

From: Date: Fri, 27 Aug 2021 12:07:41 +0000
Subject: Bug #72904 [Opn->Ver]: proc_open drops hyphenated environment variables
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236115@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72904&edit=1 ID: 72904 Updated by: cmb@php.net Reported by: PeterJCLaw at gmail dot com Summary: proc_open drops hyphenated environment variables -Status: Open +Status: Verified Type: Bug -Package: Scripting Engine problem +Package: Program Execution Operating System: Ubuntu -PHP Version: 7.0.10 +PHP Version: 7.4 Block user comment: N Private report: N New Comment: I can confirm that behavior on Debian 9 (WSL 1) with PHP-7.4; Windows 10 yields the expected results. Previous Comments: ------------------------------------------------------------------------ [2016-08-20 00:54:26] PeterJCLaw at gmail dot com Description: ------------ Environment variables with hyphens in their names (e.g: getenv('A-B')) are lost when proc_open creates a child process (other process launching functions untested). Given that these appear to be valid (they're supported by 'env' on Ubuntu) and *worked under PHP 5* this seems to be a regression. Test script: --------------- https://gist.github.com/PeterJCLaw/23719e515c787e70b614f45392dc21aa Expected result: ---------------- -- SUBPROCESS START -- A-B=ZZZ FOO=BAR getenv("INNER"): aeiou getenv("INNER-VAR"): aeiou done command returned 0 -- SUBPROCESS END -- Actual result: -------------- -- SUBPROCESS START -- A-B= FOO=BAR getenv("INNER"): aeiou getenv("INNER-VAR"): done command returned 0 -- SUBPROCESS END -- ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72904&edit=1

« previous php.bugs (#236115) next »