Bug #79528 [NEW]: Different object of the same xml between 7.4.5 and 7.4.4

From: Date: Mon, 27 Apr 2020 07:38:09 +0000
Subject: Bug #79528 [NEW]: Different object of the same xml between 7.4.5 and 7.4.4
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226792@lists.php.net to get a copy of this message
From:             roke22 at gmail dot com
Operating system: Linux
PHP version:      7.4.5
Package:          SimpleXML related
Bug Type:         Bug
Bug description:Different object of the same xml between 7.4.5 and 7.4.4

Description:
------------
---
From manual page: https://php.net/function.simplexml-load-string
---

We got different object when we read the same xml with php 7.4.4 and
7.4.5.

In php 7.4.4 we got a SimpleXMLElement object with an array.
In php 7.4.5 we got a SimpleXMLElement object with SimpleXMLElement
objects.

This cause different behaviour on the same code. I think that in minor
changes this have to be the same result.

Test script:
---------------
<?php
$resultado = simplexml_load_string("<value1><value2><value3
valueinside='1'>17321</value3><value3
valueinside='2'>17321</value3></value2></value1>");
var_dump($resultado);

Expected result:
----------------
We expect the same resulto on both versions.

Actual result:
--------------
root@400e641ac608:/# php --version
PHP 7.4.5 (cli) (built: Apr 17 2020 11:29:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v2.9.4, Copyright (c) 2002-2020, by Derick Rethans
root@400e641ac608:/# cd /var/www/html/
root@400e641ac608:/var/www/html# php prueba.php 
/var/www/html/prueba.php:3:
class SimpleXMLElement#1 (1) {
  public $value2 =>
  class SimpleXMLElement#2 (1) {
    public $value3 =>
    array(2) {
      [0] =>
      class SimpleXMLElement#3 (2) {
        ...
      }
      [1] =>
      class SimpleXMLElement#4 (2) {
        ...
      }
    }
  }
}


root@757c3e5e6b91:/var/www/html# php --version
PHP 7.4.4 (cli) (built: Apr 16 2020 15:22:19) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v2.9.4, Copyright (c) 2002-2020, by Derick Rethans
root@757c3e5e6b91:/var/www/html# php prueba.php 
/var/www/html/prueba.php:3:
class SimpleXMLElement#1 (1) {
  public $value2 =>
  class SimpleXMLElement#2 (1) {
    public $value3 =>
    array(2) {
      [0] =>
      string(5) "17321"
      [1] =>
      string(5) "17321"
    }
  }
}


-- 
Edit bug report at https://bugs.php.net/bug.php?id=79528&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=79528&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=79528&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=79528&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=79528&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=79528&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=79528&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=79528&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=79528&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=79528&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=79528&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79528&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=79528&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=79528&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=79528&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=79528&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=79528&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=79528&r=mysqlcfg


Thread (9 messages)

« previous php.bugs (#226792) next »