|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-03 22:05 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
Description: ------------ Maybe it's ok, because $root->node is not a string, but object. But then PHP must return error when trying to do so, I think. Reproduce code: --------------- <? $xml = "<root><node>data</node></root>"; $root = simplexml_load_string($xml); $str = $root->node; echo "'" . $str . "'<br/>\n"; echo "'" . $str{0} . "'<br/>\n"; echo "'" . $str{1} . "'<br/>\n"; $str = strval($root->node); echo "'" . $str . "'<br/>\n"; echo "'" . $str{0} . "'<br/>\n"; echo "'" . $str{1} . "'<br/>\n"; ?> Expected result: ---------------- 'data' 'd' 'a' 'data' 'd' 'a' Actual result: -------------- 'data' 'data' '' 'data' 'd' 'a'