ID: 24945 Updated by: [EMAIL PROTECTED] Reported By: tater at potatoe dot com -Status: Assigned +Status: Closed Bug Type: XML related Operating System: * PHP Version: 5CVS-2003-08-10 (dev) Assigned To: sterling New Comment:
This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2003-08-04 23:27:36] tater at potatoe dot com Description: ------------ I don't even know if this is supposed to work yet or not. May also be related to #24392 issues. Doing foreach($xmlobject as $property => $value) goes into an infinite loop. I tried it on a stdClass object and it worked OK. Oh and it segfaults when i bail with a user_error() but who knows if that's related... Reproduce code: --------------- $xml = simplexml_load_string('<outer><inner>4</inner></outer>'); var_dump($xml); $bound = 0; foreach ($xml as $p => $v) { var_dump($p,$v); if (++$bound > 5) user_error("Yikes!", E_USER_ERROR); } Expected result: ---------------- object(simplexml_element)#1 (1) { ["inner"]=> string(1) "4" } string(5) "inner" string(1) "4" Actual result: -------------- object(simplexml_element)#1 (1) { ["inner"]=> string(1) "4" } string(5) "inner" string(1) "4" string(5) "inner" string(1) "4" string(5) "inner" string(1) "4" string(5) "inner" string(1) "4" string(5) "inner" string(1) "4" string(5) "inner" string(1) "4" Fatal error: Yikes! in /usr/local/book/apache/htdocs/cvsbook/php5/bugs/simplexml/test.php on line 9 Segmentation fault ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24945&edit=1