Bug #68946 [Ver->Opn]: simplexml_load_string() result depends on formatting of xml string

From: Date: Wed, 27 May 2015 00:25:42 +0000
Subject: Bug #68946 [Ver->Opn]: simplexml_load_string() result depends on formatting of xml string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192907@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68946&edit=1

 ID:                 68946
 Updated by:         cmb@php.net
 Reported by:        danielhintermann at yahoo dot de
 Summary:            simplexml_load_string() result depends on formatting
                     of xml string
-Status:             Verified
+Status:             Open
 Type:               Bug
 Package:            SimpleXML related
 Operating System:   Windows
 PHP Version:        5.6.5
 Block user comment: N
 Private report:     N

 New Comment:

After further investigation I found that this issue is neither
related to bug #62693, bug #66084 nor bug #61335. Actually, the
different behavior is caused by PHP 5 converting the
SimpleXMLElement object to string, but PHP 7 is converting to
bool.

According to the comments above, this issue might not qualify as
bug for PHP 5.


Previous Comments:
------------------------------------------------------------------------
[2015-05-26 20:25:47] cmb@php.net

Confirmed: <http://3v4l.org/c8RMA>. (Already fixed in
master.)

------------------------------------------------------------------------
[2015-05-26 19:28:24] cmb@php.net

Related To: Bug #61335

------------------------------------------------------------------------
[2015-05-26 19:06:17] cmb@php.net

Related To: Bug #66084

------------------------------------------------------------------------
[2015-05-26 12:16:43] cmb@php.net

Related To: Bug #62639

------------------------------------------------------------------------
[2015-01-29 20:21:02] cmbecker69 at gmx dot de

I have to correct myself. According to the PHP language
specification[1], comparing an object and a boolean for equality
causes the object to be converted to boolean. Apparently, this is
not documented in the PHP manual. Anyhow, conversion to boolean is
documented in the PHP manual[2], and all (PHP 5) objects are
converted to true, except "SimpleXML objects created from empty
tags". Unfortunately, this description is confusing, at best.

[1] <https://github.com/php/php-langspec>
[2] <http://php.net/manual/en/language.types.boolean.php#language.types.boolean.casting>

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=68946


--
Edit this bug report at https://bugs.php.net/bug.php?id=68946&edit=1


Thread (7 messages)

« previous php.bugs (#192907) next »