#36611 [Opn->Csd]: assignment change variable-type
| From: | tony2001@php.net | Date: | Sun, 05 Mar 2006 15:35:24 +0000 |
| Subject: | #36611 [Opn->Csd]: assignment change variable-type | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93933@lists.php.net to get a copy of this message | ||
ID: 36611
Updated by: tony2001@php.net
Reported By: milman at gmx dot de
-Status: Open
+Status: Closed
Bug Type: SimpleXML related
Operating System: WindowsXP
PHP Version: 5.1.2
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-03-04 15:47:32] milman at gmx dot de
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"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36611&edit=1