#30572 [NEW]: Testing attribute="true" as boolean crashed php cli

From: Date: Tue, 26 Oct 2004 20:52:08 +0000
Subject: #30572 [NEW]: Testing attribute="true" as boolean crashed php cli
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-68127@lists.php.net to get a copy of this message
From: adam dot stout at ncr dot com Operating system: WinXP PHP version: 5.0.1 PHP Bug Type: SimpleXML related Bug description: Testing attribute="true" as boolean crashed php cli 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. -- Edit bug report at http://bugs.php.net/?id=30572&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30572&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30572&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30572&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30572&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30572&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30572&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30572&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30572&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30572&r=support Expected behavior: http://bugs.php.net/fix.php?id=30572&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30572&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30572&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30572&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30572&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30572&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30572&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30572&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30572&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30572&r=mysqlcfg

« previous php.bugs (#68127) next »