From: php at tothebrim dot net Operating system: Windows XP Professional PHP version: 5.1.4 PHP Bug Type: SimpleXML related Bug description: foreach(SimpleXMLElement... ittermittently continues indefinately
Description: ------------ This code works perfectly in version 5.1.2. I needed to upgrade in order to make use of simpleXMLElement->addChild and simpleXMLElement->addAttribute I have attempted this with 5.1.3, 5.1.4 and 5.2 with Apache 2.0.58 and 5.2 and 6.0 with Apache 2.2 and the same problem occurs each time. Max process time is exceeded, when I trace the problem I find that the same value is returned repeatedly in foreach. I have some foreach statements that continue to work, even using a SimpleXMLElement, but others fail every time. Reproduce code: --------------- function save_inputs($filename) { $doc = simplexml_load_file($filename); print "27<br/>"; foreach($doc as $key=>$value) { print "29<br/>"; if (sizeof($value->children()) && $value['type'] == "1") { print "31<br/>"; $value['combine'] = $_POST["combine~$key"]; print "33<br/>"; process_rows($doc,$key, $value); print "35<br/>"; } elseif($value['type'] == "1") { print "37<br/>"; post_child_row($doc, $key, $value); print "39<br/>"; } } $doc->asXML($filename); } Expected result: ---------------- Max Process Time Exceeded Actual result: -------------- Complete the foreach -- Edit bug report at http://bugs.php.net/?id=37644&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37644&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37644&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37644&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37644&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37644&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37644&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37644&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37644&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37644&r=support Expected behavior: http://bugs.php.net/fix.php?id=37644&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37644&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37644&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37644&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37644&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37644&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37644&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37644&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37644&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37644&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37644&r=mysqlcfg