3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0"?> <response><error code="0" message="" details=""></error><data><item id="12266824" subscriberid="47218" faxtype="0" listid="157750" fileid="858352" filename="" proprity="1" jobstatus="7" filetosend="RF20160912043659_1651144_sb47218.docx" faxnumber="83466727822" attempts="1" attemptsdone="" delay="5" nextattemptstart="2016-09-12 16:36" assigntochanel="-1" tifffilepages="1" notifyonok="0" notify="0" notifyemail="" isdialext="0" dialextval="" dialexttimeout="0" msgsend="0" arrlist="Array" schid="" priority="1"></item></data></response>'; //echo print_r(json_decode(json_encode((array) simplexml_load_string($xml)), 1), 1); function xml2array($xmlObject, $out = array()) { foreach ((array) $xmlObject as $index => $node) $out[$index . 'pref'] = ( is_object($node) ) ? xml2array($node) : $node; return $out; } echo print_r(xml2array(simplexml_load_string($xml)), 1);
Output for 5.6.0 - 5.6.25, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
Array ( [errorpref] => Array ( [@attributespref] => Array ( [code] => 0 [message] => [details] => ) ) [datapref] => Array ( [itempref] => Array ( [@attributespref] => Array ( [id] => 12266824 [subscriberid] => 47218 [faxtype] => 0 [listid] => 157750 [fileid] => 858352 [filename] => [proprity] => 1 [jobstatus] => 7 [filetosend] => RF20160912043659_1651144_sb47218.docx [faxnumber] => 83466727822 [attempts] => 1 [attemptsdone] => [delay] => 5 [nextattemptstart] => 2016-09-12 16:36 [assigntochanel] => -1 [tifffilepages] => 1 [notifyonok] => 0 [notify] => 0 [notifyemail] => [isdialext] => 0 [dialextval] => [dialexttimeout] => 0 [msgsend] => 0 [arrlist] => Array [schid] => [priority] => 1 ) ) ) )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
194.26 ms | 409 KiB | 5 Q