|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-03-05 16:35 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
Description: ------------ the assignment in function f to the simplexml-object changes the type of the righthand variable from int to string. Reproduce code: --------------- <? $xml_str = <<<EOD <?xml version="1.0" encoding="ISO-8859-1" ?> <c_fpobel > <pos > <pos/> </pos> </c_fpobel> EOD; function f ( $obj, $ii ) { $idx = (int) $ii ; $obj->pos["act_idx"] = $idx ; echo "that should be int not string<br>\n" ; var_dump($idx) ; } $xml = simplexml_load_string ($xml_str) ; f ($xml, 1) ; ?> Expected result: ---------------- int(1) Actual result: -------------- string(1) "1"