#47410 [Opn]: array_combine() crashing code when in the background

From: Date: Sat, 21 Feb 2009 13:29:55 +0000
Subject: #47410 [Opn]: array_combine() crashing code when in the background
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-134067@lists.php.net to get a copy of this message
ID: 47410 Updated by: felipe@php.net Reported By: helenadeus at gmail dot com Status: Open Bug Type: Arrays related Operating System: Linux PHP Version: 5.2CVS-2009-02-16 (snap) New Comment: I can't reproduce it. Previous Comments: ------------------------------------------------------------------------ [2009-02-16 20:01:34] helenadeus at gmail dot com 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 this bug report at http://bugs.php.net/?id=47410&edit=1

« previous php.bugs (#134067) next »