Bug #71868 [NEW]: Environment variables with no value are filtered out by proc_open()
| From: | enrico dot stahn at gmail dot com | Date: | Mon, 21 Mar 2016 14:12:12 +0000 |
| Subject: | Bug #71868 [NEW]: Environment variables with no value are filtered out by proc_open() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-199993@lists.php.net to get a copy of this message | ||
From: enrico dot stahn at gmail dot com
Operating system: Debian
PHP version: 5.6.19
Package: Program Execution
Bug Type: Bug
Bug description:Environment variables with no value are filtered out by proc_open()
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 bug report at https://bugs.php.net/bug.php?id=71868&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71868&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71868&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71868&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71868&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71868&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71868&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71868&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71868&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71868&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71868&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71868&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71868&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71868&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71868&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71868&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71868&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71868&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71868&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71868&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71868&r=mysqlcfg