php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30572 Testing attribute="true" as boolean crashed php cli
Submitted: 2004-10-26 22:52 UTC Modified: 2004-10-27 00:47 UTC
From: adam dot stout at ncr dot com Assigned:
Status: Closed Package: SimpleXML related
PHP Version: 5.0.1 OS: WinXP
Private report: No CVE-ID: None
 [2004-10-26 22:52 UTC] adam dot stout at ncr dot com
Description:
------------
Then converting a text value of a boolean to an actual boolean PHP crashes after doing the conversion.  If you don't convert to boolean and compare text to text it is fine.



Reproduce code:
---------------
<?
$XML = simplexml_load_file("test.xml");
if($XML['boolean'] == "true") {echo "Attribute is the text true\n";}
if($XML['boolean'] == true) {echo "Attribute is the boolean true\n";}
?>

XML file contents (1 line):
<test boolean="true"/>


Expected result:
----------------
Attribute is the text true
Attribute is the boolean true



Actual result:
--------------
Attribute is the text true
Attribute is the boolean true

But PHP crashed.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-27 00:47 UTC] iliaa@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC