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"; } foreach ($data as $information) { print_r($information); }
Output for 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 Warning: foreach() argument must be of type array|object, null given in /in/2t9Op on line 16
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
json decode Warning: Invalid argument supplied for foreach() in /in/2t9Op on line 16
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/2t9Op 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/2t9Op 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/2t9Op 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/2t9Op on line 11

preferences:
229.13 ms | 401 KiB | 344 Q