ID: 32641 User updated by: php dot bug at hebbron dot com Reported By: php dot bug at hebbron dot com -Status: Open +Status: Bogus Bug Type: DOM XML related Operating System: Linux PHP Version: 5.0.4 New Comment:
See above - bogus Previous Comments: ------------------------------------------------------------------------ [2005-04-09 11:34:16] php dot bug at hebbron dot com Apologies: tried again on another machine - I thought I'd disabled the Zend debugger but hadn't. It was the interaction with the debugger that was causing the problem. ------------------------------------------------------------------------ [2005-04-09 10:55:19] php dot bug at hebbron dot com 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32641&edit=1