Bug #81279 [Opn]: Inconsistant parsing with simplexml_load_string function
Edit report at https://bugs.php.net/bug.php?id=81279&edit=1
ID: 81279
Updated by: cmb@php.net
Reported by: a dot gargasas1238 at gmail dot com
Summary: Inconsistant parsing with simplexml_load_string
function
Status: Open
Type: Bug
Package: SimpleXML related
Operating System: irrelavant
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Confirmed: <https://3v4l.org/GGGnX>.
The problem is that the whitespaces are parsed as text nodes, and
SimpleXML has known issues with mixed content, especially
regarding debug output (such as var_dump()).
Previous Comments:
------------------------------------------------------------------------
[2021-07-21 15:39:00] a dot gargasas1238 at gmail dot com
Description:
------------
bug appears in versions:
7.0.5 and later
description:
Parsing XML string returns inconsistent values. When parsing single XML element with new lines (unix
(\n) or win(\r\n)) resulting element will be array. When new line tags are removed element turns
into object value.
Test script:
---------------
https://pastebin.com/hfv4bMZ8
Expected result:
----------------
Consistent result of parsing element as object value, or as array
Actual result:
--------------
Inconsistent result: mix of object value and array
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81279&edit=1
Thread (2 messages)