Forums / Developer / Problems with foreach() and Return by Reference / Comment47282
Claudia Kosny
Thursday 09 November 2006 3:13:34 am
Hi Eirik
If you check the sample code in lib/ezxml/classes/ezdomdocument.php you can see that they don't use references here:
$guppy = $doc->createElementNode( "Guppy" ); $guppy->appendChild( $doc->createTextNode( "Guppy is a small livebreeder." ) );
whereas you use one:
$dateTime =& $doc->createElementNode( 'DateTime' ); $dateTime->appendChild($doc->createTextNode( $i ));
As far as I understand the way references work in PHP this should solve the problem.
Claudia