#47410 [NEW]: array_combine crashing code when in the background
| From: | helenadeus at gmail dot com | Date: | Mon, 16 Feb 2009 20:01:34 +0000 |
| Subject: | #47410 [NEW]: array_combine crashing code when in the background | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-133886@lists.php.net to get a copy of this message | ||
From: helenadeus at gmail dot com
Operating system: Linux
PHP version: 5.2CVS-2009-02-16 (snap)
PHP Bug Type: Arrays related
Bug description: array_combine crashing code when in the background
Description:
------------
I'm running a script which tries to run something else in the
background, like such:
This code is inside a script called waiting.php
<?php
popen("php -f stall.php > tmp &','r');
?>
and stall.php is:
<?php
$V=array_combine(array('a','b','c'),array(1,2,3));
foreach ($V as $k=>$v) {
echo $V[$k].chr(10);
}
?>
It works fine... until I use the function "array_combine" in the
script stall.php
For some reason, even though this function works fine both in the
console and through apache, it crashes my code whenever I try to run
it in the background. Any thoughts on why this happens?
Reproduce code:
---------------
This code is inside a script called waiting.php
<?php
popen("php -f stall.php > tmp &','r');
?>
and stall.php is:
<?php
$V=array_combine(array('a','b','c'),array(1,2,3));
foreach ($V as $k=>$v) {
echo $V[$k].chr(10);
}
?>
Expected result:
----------------
tmp:
1
2
3
Actual result:
--------------
tmp is empty
--
Edit bug report at http://bugs.php.net/?id=47410&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47410&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47410&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47410&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47410&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47410&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47410&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47410&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47410&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47410&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47410&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47410&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47410&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47410&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47410&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47410&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47410&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47410&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47410&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47410&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47410&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47410&r=mysqlcfg