|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-08 10:02 UTC] chregu@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 03:00:01 2025 UTC |
Description: ------------ When adding a subelement of the xml object to an array, it becomes an object again? "echo" doesn't return an object ... Reproduce code: --------------- $xml = simplexml_load_string($this->xml); foreach($xml->LISTENERS->LISTENER as $listener) { echo $listener->HOSTNAME; // Last element in tree $hosts[] = $listener->HOSTNAME; } Expected result: ---------------- 127.0.0.1 Array( [0] => 127.0.0.1 ) Actual result: -------------- 127.0.0.1 Array( [0] => SimpleXMLElement Object( [0] => 127.0.0.1 ) )