Bug #71868 [Com]: Environment variables with no value are filtered out by proc_open()

From: Date: Thu, 14 Apr 2016 23:01:48 +0000
Subject: Bug #71868 [Com]: Environment variables with no value are filtered out by proc_open()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200553@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71868&edit=1 ID: 71868 Comment by: chrispmaiden at gmail dot com Reported by: enrico dot stahn at gmail dot com Summary: Environment variables with no value are filtered out by proc_open() Status: Open Type: Bug Package: Program Execution Operating System: Debian PHP Version: 5.6.19 Block user comment: N Private report: N New Comment: 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 https://github.com/matason/php-src/commit/eab2ae391702f4287fad7c9885d45585d606464f 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. Best, Chris Previous Comments: ------------------------------------------------------------------------ [2016-03-21 14:13:15] enrico dot stahn at gmail dot com https://github.com/symfony/symfony/issues/18170#issuecomment-199225778 ------------------------------------------------------------------------ [2016-03-21 14:12:09] enrico dot stahn at gmail dot com Description: ------------ Empty environment variables passed to proc_open are filtered out. Test script: --------------- <?php // process.php $env = ['FOO' => 'abc', 'BAR' => '']; $pipes = []; $process = proc_open('./env.php', [], $pipes, pwd, $env); proc_close($process); #!/usr/bin/php <?php // env.php var_dump($_SERVER['FOO']); var_dump($_SERVER['BAR']); php process.php will output: string(3) "abc" PHP Notice: Undefined index: BAR in /Users/kuba/Projects/symfony/issues/env.php on line 6 NULL ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71868&edit=1

« previous php.bugs (#200553) next »