|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-11-06 15:54 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Mar 28 09:00:02 2026 UTC |
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