|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36611 assignment change variable-type
Submitted: 2006-03-04 15:47 UTC Modified: 2006-03-05 16:35 UTC
From: milman at gmx dot de Assigned:
Status: Closed Package: SimpleXML related
PHP Version: 5.1.2 OS: WindowsXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: milman at gmx dot de
New email:
PHP Version: OS:


 [2006-03-04 15:47 UTC] milman at gmx dot de
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 >

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:

Actual result:
string(1) "1" 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-05 16:35 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 13:01:32 2024 UTC