Bug #79528 [ReO->Csd]: Different object of the same xml between 7.4.5 and 7.4.4
| From: | cmb@php.net | Date: | Fri, 01 May 2020 10:43:02 +0000 |
| Subject: | Bug #79528 [ReO->Csd]: Different object of the same xml between 7.4.5 and 7.4.4 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226871@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79528&edit=1
ID: 79528
Updated by: cmb@php.net
Reported by: roke22 at gmail dot com
Summary: Different object of the same xml between 7.4.5 and
7.4.4
-Status: Re-Opened
+Status: Closed
Type: Bug
Package: SimpleXML related
Operating System: Linux
PHP Version: 7.4.5
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=54148fd68677e8b13b5a11c309c601d1248fb78b
Log: Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
Previous Comments:
------------------------------------------------------------------------
[2020-05-01 10:14:19] cmb@php.net
In hindsight, I agree that this should not have been changed in
revision releases, so I'm going to revert, and also check with the
release managers whether the revert can be applied to PHP 7.3.18
and 7.4.6.
Furthermore, the new behavior still doesn't make sense[1], so
perhaps sticking with the old behavior even for PHP 8 might be
best.
[1] <https://3v4l.org/SPp3f>
------------------------------------------------------------------------
[2020-04-30 22:20:45] nikic@php.net
@cmb: Looks like this had some unintended effects.
------------------------------------------------------------------------
[2020-04-30 21:55:53] ttijhof at wikimedia dot org
This changed has caused observable changes in user-land code in a bug release, which seems like
something that should not happen.
An isolated test case exists at https://3v4l.org/HtN9R.
This is not debugging output, these are run-time return values. And it doesn't even rely on
reflection or something hacky like that.
I would expect a breaking change of this kind, where the API provides an entirely different return
value (string vs array of objects), to be something that happens in a major release like PHP 8.0,
not in a minor release, and most definitely not in a patch release to PHP 7.3 or PHP 7.4. Even then
I would think such change, which is hard to support both versions of, would probably benefit from a
feature flag, run-time option, or some other method name so that there is a deprecation notice and
so that one can actually do a running migration.
------------------------------------------------------------------------
[2020-04-27 07:53:59] nikic@php.net
To be clear, this should have changed only debug output, not anything else.
------------------------------------------------------------------------
[2020-04-27 07:48:03] requinix@php.net
The change in behavior is a result of a bug fix - see bug #61597.
The problem was that nodes with attributes were being treated as strings in cases that they should
not have been. Your example is one such case: the <value3> elements have attributes so simply
treating them as strings would lose that data.
------------------------------------------------------------------------
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=79528
--
Edit this bug report at https://bugs.php.net/bug.php?id=79528&edit=1