3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $json = '{"@attributes":{"type":"3"},"body":{"car":[{"@attributes":{"num":"01","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"3"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"3","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]},{"@attributes":{"num":"03","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"4"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"4","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]},{"@attributes":{"num":"08","tos_id":"1050","cost":"612.71","ccy":"UAH","car_class":"\u0411","free_count":"1"},"places":[{"@attributes":{"tos_id":"1050","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"612.71","ccy":"UAH"}},{"@attributes":{"tos_id":"1050","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"1","cost":"612.71","ccy":"UAH"}},{"@attributes":{"tos_id":"1050","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"612.71","ccy":"UAH"}},{"@attributes":{"tos_id":"1050","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"612.71","ccy":"UAH"}}]},{"@attributes":{"num":"11","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"2"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"2","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]},{"@attributes":{"num":"13","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"1"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"1","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]},{"@attributes":{"num":"14","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"6"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"6","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]},{"@attributes":{"num":"15","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"4"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"4","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]},{"@attributes":{"num":"16","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"7"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"7","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]},{"@attributes":{"num":"17","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"3"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"3","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]},{"@attributes":{"num":"18","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"6"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"6","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]},{"@attributes":{"num":"19","tos_id":"1040","cost":"223.90","ccy":"UAH","car_class":"\u0411","free_count":"7"},"places":[{"@attributes":{"tos_id":"1040","loc_id":"1001","loc_desc":"\u0416\u0414 \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"7","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1002","loc_desc":"\u0416\u0414 \u043d\u0438\u0436\u043d\u0435\u0435 \u043d\u0435 \u0431\u043e\u043a\u043e\u0432\u043e\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1003","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}},{"@attributes":{"tos_id":"1040","loc_id":"1004","loc_desc":"\u0416\u0414 \u0431\u043e\u043a\u043e\u0432\u043e\u0435 \u043d\u0438\u0436\u043d\u0435\u0435","free_count":"0","cost":"223.90","ccy":"UAH"}}]}]}}'; $decoded = json_decode($json); print_r([ $decoded->{'@attributes'}, $decoded->body->car[0], ]);
Output for 5.4.0 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => stdClass Object ( [type] => 3 ) [1] => stdClass Object ( [@attributes] => stdClass Object ( [num] => 01 [tos_id] => 1040 [cost] => 223.90 [ccy] => UAH [car_class] => Б [free_count] => 3 ) [places] => Array ( [0] => stdClass Object ( [@attributes] => stdClass Object ( [tos_id] => 1040 [loc_id] => 1001 [loc_desc] => ЖД верхнее не боковое [free_count] => 3 [cost] => 223.90 [ccy] => UAH ) ) [1] => stdClass Object ( [@attributes] => stdClass Object ( [tos_id] => 1040 [loc_id] => 1002 [loc_desc] => ЖД нижнее не боковое [free_count] => 0 [cost] => 223.90 [ccy] => UAH ) ) [2] => stdClass Object ( [@attributes] => stdClass Object ( [tos_id] => 1040 [loc_id] => 1003 [loc_desc] => ЖД бокове верхнее [free_count] => 0 [cost] => 223.90 [ccy] => UAH ) ) [3] => stdClass Object ( [@attributes] => stdClass Object ( [tos_id] => 1040 [loc_id] => 1004 [loc_desc] => ЖД боковое нижнее [free_count] => 0 [cost] => 223.90 [ccy] => UAH ) ) ) ) )
Output for 5.2.3 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/KENql on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.2
<br /> <b>Parse error</b>: syntax error, unexpected '[', expecting ')' in <b>/in/KENql</b> on line <b>6</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
<br /> <b>Parse error</b>: parse error, unexpected '[', expecting ')' in <b>/in/KENql</b> on line <b>6</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `')'' in <b>/in/KENql</b> on line <b>6</b><br />
Process exited with code 255.