Bug #73057 [NEW]: Casting a SimpleXMLElement to an array does exhibit differing behavior
| From: | brian dot mcclure at adition dot com | Date: | Fri, 09 Sep 2016 12:38:31 +0000 |
| Subject: | Bug #73057 [NEW]: Casting a SimpleXMLElement to an array does exhibit differing behavior | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-203910@lists.php.net to get a copy of this message | ||
From: brian dot mcclure at adition dot com
Operating system: Ubuntu 16.04
PHP version: Irrelevant
Package: SimpleXML related
Bug Type: Bug
Bug description:Casting a SimpleXMLElement to an array does exhibit differing behavior
Description:
------------
According to 5.4 changenotes,
http://php.net/manual/en/migration54.other.php
there is some sort of behavior change to be expected when casting a
SimnpleXMLElement to an array. But unless I'm misunderstanding what the
docs mean, the bahavior is consistent all the way from 5.1 to 7.1
https://3v4l.org/F4DfI
If this is not a bug, would someone mind providing an example of the
before and after behavior?
Test script:
---------------
<?php
$xml =
"<xml><first-node>foo</first-node><second-node><nested-node>bar</nested-node></second-node><third-node>baz</third-node></xml>";
$a = new SimpleXMLElement($xml);
var_export((array)$a);
--
Edit bug report at https://bugs.php.net/bug.php?id=73057&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73057&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73057&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73057&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73057&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73057&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73057&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73057&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73057&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73057&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73057&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73057&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73057&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73057&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73057&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73057&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73057&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73057&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73057&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73057&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73057&r=mysqlcfg