ID: 32104
Updated by: [EMAIL PROTECTED]
Reported By: ppetermann at vivaplus dot tv
-Status: Open
+Status: Feedback
Bug Type: DOM XML related
Operating System: tested on Linux and Solaris
PHP Version: 5CVS-2005-02-25 (dev)
Previous Comments:
------------------------------------------------------------------------
[2005-02-25 20:39:56] [EMAIL PROTECTED]
still cannot reproduce and this time on a fresh linux box.
can you try rebuilding your php (making sure to clean it first) and if
still doesnt work post a link to you phpinfo.
------------------------------------------------------------------------
[2005-02-25 15:08:16] ppetermann at vivaplus dot tv
hi,
php5-STABLE-200502250930 is the snapshot i used,
well, the missing s was an error in my report, in my code its with the
s (as i said its working on php 5.0.3 (in production)
------------------------------------------------------------------------
[2005-02-25 15:01:57] [EMAIL PROTECTED]
sure you are using the latest snapshot?
using your code I get (both with latest 5_0 and HEAD):
Warning: Invalid argument supplied for foreach() in N:\CVS
Projects\php5_0\Debug_TS\bug32104.php on line 4
using ->childNodes (which is correct) works fine
------------------------------------------------------------------------
[2005-02-25 11:44:15] ppetermann at vivaplus dot tv
Description:
------------
doing a foreach loop on:
$dom->documentElement->childNode
causes an Fatal Error:
Fatal error: Cannot access undefined property for object with
overloaded property access in FILE on line LINENUMBEROFFOREACH
this didnt happen in PHP5 <= 5.0.3
Reproduce code:
---------------
<?php
$dom = new DomDocument();
$dom->load("xmlfile.xml);
foreach($dom->documentElement->childNode as $node)
{
echo "foo\n";
}
?>
Expected result:
----------------
a foo\n for each childnode of the document element
Actual result:
--------------
Fatal error: Cannot access undefined property for object with
overloaded property access in /foo/bar/myfile.php on line 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32104&edit=1