|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-09 11:34 UTC] php dot bug at hebbron dot com
[2005-04-09 11:35 UTC] php dot bug at hebbron dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
Description: ------------ The following code works fine on 5.0.2, but causes the fatal error on 5.0.4. Using for($i; $i<$d->documentElement->childNodes->length; $i++){} loop works fine, bt the foreach version is now broken. Reproduce code: --------------- $d = new DOMDocument(); $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <root> <child></child> <child></child> <child></child> <child></child> </root> XML; $d->loadXML($xml); foreach($d->documentElement->childNodes AS $child){ print($child->nodeName."\n"); } Expected result: ---------------- #text child #text child #text child #text child #text child #text Actual result: -------------- Fatal error: Cannot access undefined property for object with overloaded property access in /home/tom/test/bug_reports/overloaded.php on line 15