3v4l.org

run code in 300+ PHP versions simultaneously
<?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'];
Output for git.master, git.master_jit
Deprecated: Function utf8_decode() is deprecated in /in/2HB8G on line 4 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 ) Warning: Undefined array key "PAR" in /in/2HB8G on line 8 Warning: Trying to access array offset on value of type null in /in/2HB8G on line 8 Warning: Trying to access array offset on value of type null in /in/2HB8G on line 8
Output for rfc.property-hooks
Deprecated: Function utf8_decode() is deprecated in /in/2HB8G on line 4 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 ) Warning: Undefined array key "PAR" in /in/2HB8G on line 8 Warning: Trying to access array offset on null in /in/2HB8G on line 8 Warning: Trying to access array offset on null in /in/2HB8G on line 8

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
55.03 ms | 409 KiB | 8 Q