3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new SimpleXMLElement("<response type='5'> <body order_code='9ee56c2e5-de9b-4d13-a2bd-4175c6f43b97' pay_summ='166.37' comiss='7.16' comiss_descr='Комиссия банка: 3 грн + 2,5% от стоимости билета. Сервисный сбор РЦ Министерства транспорта и связи Укр - 18 грн' total_summ='173.53'> <trip-segment ticket='21П-Н1-1847975-1906' creation_time='19.06.2013 08:57:28' num='1' tot_price='166.37' transporte_type='2' tax='3.00'> <places> <place car_num='15' car_type='1040' loc_num='06' /> </places> </trip-segment> </body> </response>"); var_dump($xml->body);
Output for 5.1.2 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(5) { ["order_code"]=> string(37) "9ee56c2e5-de9b-4d13-a2bd-4175c6f43b97" ["pay_summ"]=> string(6) "166.37" ["comiss"]=> string(4) "7.16" ["comiss_descr"]=> string(194) "Комиссия банка: 3 грн + 2,5% от стоимости билета. Сервисный сбор РЦ Министерства транспорта и связи Укр - 18 грн" ["total_summ"]=> string(6) "173.53" } ["trip-segment"]=> object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(6) { ["ticket"]=> string(21) "21П-Н1-1847975-1906" ["creation_time"]=> string(19) "19.06.2013 08:57:28" ["num"]=> string(1) "1" ["tot_price"]=> string(6) "166.37" ["transporte_type"]=> string(1) "2" ["tax"]=> string(4) "3.00" } ["places"]=> object(SimpleXMLElement)#5 (1) { ["place"]=> object(SimpleXMLElement)#6 (1) { ["@attributes"]=> array(3) { ["car_num"]=> string(2) "15" ["car_type"]=> string(4) "1040" ["loc_num"]=> string(2) "06" } } } } }
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
object(SimpleXMLElement)#2 (1) { ["trip-segment"]=> object(SimpleXMLElement)#4 (1) { ["places"]=> object(SimpleXMLElement)#5 (1) { ["place"]=> object(SimpleXMLElement)#6 (0) { } } } }
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/sgHPc on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/sgHPc on line 2

preferences:
244.81 ms | 401 KiB | 400 Q