3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = '<?xml version="1.0" encoding="UTF-8"?> <response response_code="0"> <initial_orders initial_order_total_price="2.3958"> <initial_order article_group_name="Conjunto de prueba 1"> <initial_order_lines> <initial_order_line article_cn6="123456" article_description="Artículo de prueba 1" article_pvl="1" article_initial_order_units="1" article_discount="1"/> <initial_order_line article_cn6="123457" article_description="Artículo de prueba 2" article_pvl="1" article_initial_order_units="1" article_discount="1"/> </initial_order_lines> </initial_order> </initial_orders> </response>'; $bar = simplexml_load_string($foo); $bax = json_encode($bar); $baz = json_decode($bax, true); print_r(count($baz['initial_orders']['initial_order']));
based on vc5Rs
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0beta1
2