Doc #79485 [NEW]: Minor version update changed how json_encode serialzies SimpleXMLElement

From: Date: Fri, 17 Apr 2020 11:55:15 +0000
Subject: Doc #79485 [NEW]: Minor version update changed how json_encode serialzies SimpleXMLElement
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17496@lists.php.net to get a copy of this message
From: p dot szymkowski at lottestyle dot de Operating system: Linux PHP version: 7.3.17 Package: JSON related Bug Type: Documentation Problem Bug description:Minor version update changed how json_encode serialzies SimpleXMLElement Description: ------------ Minor update 7.3.16 -> 7.3.17 changed json_encode() behaviour and it's not documented or mentioned in change log Test script: --------------- <?php $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <Response> <Element someAttribute="foo">Bar</Element> </Response> XML; echo json_encode(simplexml_load_string($xml), true); Expected result: ---------------- {"Element":"Bar"} Actual result: -------------- {"Element":{"@attributes":{"someAttribute":"foo"},"0":"Bar"}} -- Edit bug report at https://bugs.php.net/bug.php?id=79485&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79485&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79485&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79485&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79485&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79485&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79485&r=support Expected behavior: https://bugs.php.net/fix.php?id=79485&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79485&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79485&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79485&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79485&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79485&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79485&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79485&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79485&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79485&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79485&r=mysqlcfg

« previous php.doc.bugs (#17496) next »