3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '{"success":true,"data":{"HKT":{"0":{"price":34455,"airline":"I4","flight_number":9557,"departure_at":"2018-03-16T20:10:00Z","return_at":"2018-03-28T12:00:00Z","expires_at":"2018-01-15T22:54:59Z"},"1":{"price":27967,"airline":"CZ","flight_number":356,"departure_at":"2018-03-21T21:40:00Z","return_at":"2018-03-28T16:50:00Z","expires_at":"2018-01-15T11:50:37Z"},"2":{"price":26520,"airline":"CZ","flight_number":6002,"departure_at":"2018-03-13T21:40:00Z","return_at":"2018-03-25T16:50:00Z","expires_at":"2018-01-16T21:19:06Z"},"3":{"price":27570,"airline":"CZ","flight_number":6002,"departure_at":"2018-03-06T21:40:00Z","return_at":"2018-03-28T16:50:00Z","expires_at":"2018-01-14T17:57:13Z"},"4":{"price":49088,"airline":"S7","flight_number":181,"departure_at":"2018-03-06T17:20:00Z","return_at":"2018-03-07T22:45:00Z","expires_at":"2018-01-15T09:47:34Z"},"5":{"price":85262,"airline":"SU","flight_number":8153,"departure_at":"2018-03-06T09:20:00Z","return_at":"2018-03-26T04:30:00Z","expires_at":"2018-01-15T08:51:51Z"}}},"error":null,"currency":"rub"}'; $array = json_decode(utf8_decode($str), true); print_r($array); echo $array['data']['PAR'][0]['airline'];
based on FlCHY
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.21.3, 7.0.0 - 7.2.1
Array ( [success] => 1 [data] => Array ( [HKT] => Array ( [0] => Array ( [price] => 34455 [airline] => I4 [flight_number] => 9557 [departure_at] => 2018-03-16T20:10:00Z [return_at] => 2018-03-28T12:00:00Z [expires_at] => 2018-01-15T22:54:59Z ) [1] => Array ( [price] => 27967 [airline] => CZ [flight_number] => 356 [departure_at] => 2018-03-21T21:40:00Z [return_at] => 2018-03-28T16:50:00Z [expires_at] => 2018-01-15T11:50:37Z ) [2] => Array ( [price] => 26520 [airline] => CZ [flight_number] => 6002 [departure_at] => 2018-03-13T21:40:00Z [return_at] => 2018-03-25T16:50:00Z [expires_at] => 2018-01-16T21:19:06Z ) [3] => Array ( [price] => 27570 [airline] => CZ [flight_number] => 6002 [departure_at] => 2018-03-06T21:40:00Z [return_at] => 2018-03-28T16:50:00Z [expires_at] => 2018-01-14T17:57:13Z ) [4] => Array ( [price] => 49088 [airline] => S7 [flight_number] => 181 [departure_at] => 2018-03-06T17:20:00Z [return_at] => 2018-03-07T22:45:00Z [expires_at] => 2018-01-15T09:47:34Z ) [5] => Array ( [price] => 85262 [airline] => SU [flight_number] => 8153 [departure_at] => 2018-03-06T09:20:00Z [return_at] => 2018-03-26T04:30:00Z [expires_at] => 2018-01-15T08:51:51Z ) ) ) [error] => [currency] => rub ) Notice: Undefined index: PAR in /in/2HB8G on line 8
Output for hhvm-3.22.0
Array ( [success] => 1 [data] => Array ( [HKT] => Array ( [0] => Array ( [price] => 34455 [airline] => I4 [flight_number] => 9557 [departure_at] => 2018-03-16T20:10:00Z [return_at] => 2018-03-28T12:00:00Z [expires_at] => 2018-01-15T22:54:59Z ) [1] => Array ( [price] => 27967 [airline] => CZ [flight_number] => 356 [departure_at] => 2018-03-21T21:40:00Z [return_at] => 2018-03-28T16:50:00Z [expires_at] => 2018-01-15T11:50:37Z ) [2] => Array ( [price] => 26520 [airline] => CZ [flight_number] => 6002 [departure_at] => 2018-03-13T21:40:00Z [return_at] => 2018-03-25T16:50:00Z [expires_at] => 2018-01-16T21:19:06Z ) [3] => Array ( [price] => 27570 [airline] => CZ [flight_number] => 6002 [departure_at] => 2018-03-06T21:40:00Z [return_at] => 2018-03-28T16:50:00Z [expires_at] => 2018-01-14T17:57:13Z ) [4] => Array ( [price] => 49088 [airline] => S7 [flight_number] => 181 [departure_at] => 2018-03-06T17:20:00Z [return_at] => 2018-03-07T22:45:00Z [expires_at] => 2018-01-15T09:47:34Z ) [5] => Array ( [price] => 85262 [airline] => SU [flight_number] => 8153 [departure_at] => 2018-03-06T09:20:00Z [return_at] => 2018-03-26T04:30:00Z [expires_at] => 2018-01-15T08:51:51Z ) ) ) [error] => [currency] => rub ) Notice: Undefined index: PAR in /in/2HB8G on line -1