3v4l.org

run code in 300+ PHP versions simultaneously
<?php $post=array ( 'data' => '[{"page":{"identifierInteraction":"caf4282eaa1e9c79722baae95e7837b2","path":"game_form","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"16:40:23","date":"2013-12-02"}},{"page":{"identifierInteraction":"caf4282eaa1e9c79722baae95e7837b2","path":"game_slotmachine","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"16:41:22","date":"2013-12-02"}},{"page":{"identifierInteraction":"caf4282eaa1e9c79722baae95e7837b2","path":"game_win","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"16:41:31","date":"2013-12-02"}},{"page":{"identifierInteraction":"caf4282eaa1e9c79722baae95e7837b2","path":"game_end","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"16:41:46","date":"2013-12-02"}},{"page":{"identifierInteraction":"537545ab89d9747a8ca1765fb8f9d449","path":"game_form","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"17:05:36","date":"2013-12-02"}},{"page":{"identifierInteraction":"537545ab89d9747a8ca1765fb8f9d449","path":"game_slotmachine","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"17:06:45","date":"2013-12-02"}},{"page":{"identifierInteraction":"537545ab89d9747a8ca1765fb8f9d449","path":"game_loose","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"17:06:58","date":"2013-12-02"}},{"page":{"identifierInteraction":"537545ab89d9747a8ca1765fb8f9d449","path":"game_end","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"17:07:04","date":"2013-12-02"}},{"page":{"identifierInteraction":"dc457cd9ef26bb2a7f3ab40ac5530307","path":"game_form","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"17:24:08","date":"2013-12-02"}},{"page":{"identifierInteraction":"6a1d6939637e018a0da753708d2387f5","path":"game_form","identifierDevice":"B50E28DF-9C10-46B0-999C-11297122026C","hour":"08:55:09","date":"2013-12-03"}}]', ); $data = $post['data']; if(!is_array($data)) { $data = json_decode($data, true); echo "json decode done"; } var_dump($data); foreach ($data as $information) { print_r($information); }
Output for 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.40, 7.0.0 - 7.0.33, 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
json decode donearray(10) { [0]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "caf4282eaa1e9c79722baae95e7837b2" ["path"]=> string(9) "game_form" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "16:40:23" ["date"]=> string(10) "2013-12-02" } } [1]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "caf4282eaa1e9c79722baae95e7837b2" ["path"]=> string(16) "game_slotmachine" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "16:41:22" ["date"]=> string(10) "2013-12-02" } } [2]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "caf4282eaa1e9c79722baae95e7837b2" ["path"]=> string(8) "game_win" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "16:41:31" ["date"]=> string(10) "2013-12-02" } } [3]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "caf4282eaa1e9c79722baae95e7837b2" ["path"]=> string(8) "game_end" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "16:41:46" ["date"]=> string(10) "2013-12-02" } } [4]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "537545ab89d9747a8ca1765fb8f9d449" ["path"]=> string(9) "game_form" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "17:05:36" ["date"]=> string(10) "2013-12-02" } } [5]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "537545ab89d9747a8ca1765fb8f9d449" ["path"]=> string(16) "game_slotmachine" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "17:06:45" ["date"]=> string(10) "2013-12-02" } } [6]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "537545ab89d9747a8ca1765fb8f9d449" ["path"]=> string(10) "game_loose" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "17:06:58" ["date"]=> string(10) "2013-12-02" } } [7]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "537545ab89d9747a8ca1765fb8f9d449" ["path"]=> string(8) "game_end" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "17:07:04" ["date"]=> string(10) "2013-12-02" } } [8]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "dc457cd9ef26bb2a7f3ab40ac5530307" ["path"]=> string(9) "game_form" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "17:24:08" ["date"]=> string(10) "2013-12-02" } } [9]=> array(1) { ["page"]=> array(5) { ["identifierInteraction"]=> string(32) "6a1d6939637e018a0da753708d2387f5" ["path"]=> string(9) "game_form" ["identifierDevice"]=> string(36) "B50E28DF-9C10-46B0-999C-11297122026C" ["hour"]=> string(8) "08:55:09" ["date"]=> string(10) "2013-12-03" } } } Array ( [page] => Array ( [identifierInteraction] => caf4282eaa1e9c79722baae95e7837b2 [path] => game_form [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 16:40:23 [date] => 2013-12-02 ) ) Array ( [page] => Array ( [identifierInteraction] => caf4282eaa1e9c79722baae95e7837b2 [path] => game_slotmachine [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 16:41:22 [date] => 2013-12-02 ) ) Array ( [page] => Array ( [identifierInteraction] => caf4282eaa1e9c79722baae95e7837b2 [path] => game_win [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 16:41:31 [date] => 2013-12-02 ) ) Array ( [page] => Array ( [identifierInteraction] => caf4282eaa1e9c79722baae95e7837b2 [path] => game_end [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 16:41:46 [date] => 2013-12-02 ) ) Array ( [page] => Array ( [identifierInteraction] => 537545ab89d9747a8ca1765fb8f9d449 [path] => game_form [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 17:05:36 [date] => 2013-12-02 ) ) Array ( [page] => Array ( [identifierInteraction] => 537545ab89d9747a8ca1765fb8f9d449 [path] => game_slotmachine [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 17:06:45 [date] => 2013-12-02 ) ) Array ( [page] => Array ( [identifierInteraction] => 537545ab89d9747a8ca1765fb8f9d449 [path] => game_loose [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 17:06:58 [date] => 2013-12-02 ) ) Array ( [page] => Array ( [identifierInteraction] => 537545ab89d9747a8ca1765fb8f9d449 [path] => game_end [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 17:07:04 [date] => 2013-12-02 ) ) Array ( [page] => Array ( [identifierInteraction] => dc457cd9ef26bb2a7f3ab40ac5530307 [path] => game_form [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 17:24:08 [date] => 2013-12-02 ) ) Array ( [page] => Array ( [identifierInteraction] => 6a1d6939637e018a0da753708d2387f5 [path] => game_form [identifierDevice] => B50E28DF-9C10-46B0-999C-11297122026C [hour] => 08:55:09 [date] => 2013-12-03 ) )
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/Pc3bG on line 11
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/Pc3bG on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/Pc3bG on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/Pc3bG on line 11

preferences:
375.25 ms | 401 KiB | 460 Q