|  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
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: adam dot stout at ncr dot com
New email:
PHP Version: OS:


 [2004-10-26 22:52 UTC] adam dot stout at ncr dot com
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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-27 00:47 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: Thu May 30 11:01:31 2024 UTC