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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: PeterJCLaw at gmail dot com
New email:
PHP Version: OS:

 

 [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: Mon Jul 22 12:01:25 2019 UTC