ID: 37644 User updated by: php at tothebrim dot net Reported By: php at tothebrim dot net -Status: Feedback +Status: Open Bug Type: SimpleXML related Operating System: Windows XP Professional PHP Version: 5.1.4 New Comment:
I have updated the posted script, it is now complete. It can be viewed at http://tothebrim.net/php.txt Thanks, Ben Previous Comments: ------------------------------------------------------------------------ [2006-05-30 18:40:03] [EMAIL PROTECTED] We still need SHORT but COMPLETE script.. ------------------------------------------------------------------------ [2006-05-30 17:53:42] php at tothebrim dot net I was able to trace the problem to the assignment of a new value to a child. The problem code can be seen at http://tothebrim.net/php.txt Thanks for your help, Ben ------------------------------------------------------------------------ [2006-05-30 17:03:12] judas dot iscariote at gmail dot com try installing xdebug to determine what is getting into an infinite loop, and show us some code, we don't know what the "process_rows" and "post_child_row" functions do, no magic cristal bowl to guess :-) ------------------------------------------------------------------------ [2006-05-30 16:54:43] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2006-05-30 16:42:59] php at tothebrim dot net 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 this bug report at http://bugs.php.net/?id=37644&edit=1