|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71868 Environment variables with no value are filtered out by proc_open()
Submitted: 2016-03-21 14:12 UTC Modified: 2016-03-21 14:13 UTC
Avg. Score:3.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: enrico dot stahn at gmail dot com Assigned:
Status: Open Package: Program Execution
PHP Version: 5.6.19 OS: Debian
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.
Block user comment
Status: Assign to:
Bug Type:
From: enrico dot stahn at gmail dot com
New email:
PHP Version: OS:


 [2016-03-21 14:12 UTC] enrico dot stahn at gmail dot com
Empty environment variables passed to proc_open are filtered out.

Test script:
// process.php

$env = ['FOO' => 'abc', 'BAR' => ''];
$pipes = [];
$process = proc_open('./env.php', [], $pipes, `pwd`, $env);

// env.php

php process.php will output:

string(3) "abc"
PHP Notice:  Undefined index: BAR in /Users/kuba/Projects/symfony/issues/env.php on line 6


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-21 14:13 UTC] enrico dot stahn at gmail dot com
 [2016-04-14 23:01 UTC] chrispmaiden at gmail dot com
I can confirm I'm able to reproduce this behaviour on both 5 and 7 branches. I've been working on a failing test which is at

I'm pretty sure I have a fix for the 5 branch, I will follow up with that and a fix for the 7 branch.


 [2016-04-16 12:50 UTC] chrispmaiden at gmail dot com
I've pushed a commit to my fork which appears to fix the issue,

I'd appreciate review from someone who knows the code better than I!
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 07:01:29 2024 UTC