php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72904 proc_open drops hyphenated environment variables
Submitted: 2016-08-20 00:54 UTC Modified: -
From: PeterJCLaw at gmail dot com Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 7.0.10 OS: Ubuntu
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-08-20 00:54 UTC] 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 --

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 05:01:25 2019 UTC