3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "client_id": 1234, "rawdata": [{ "task_id1": { "apikey1": "1234", "flow": "ssp", "total_chocolate_request": 43235, "start_time": "2017 - 05 - 09 12: 29: 00 UTC", "end_time": "2017 - 05 - 09 12: 29: 00 UTC" }, "task_id2": { "apikey2": "1235", "flow": "mobileweb", "total_chocolate_request": 43235, "start_time": "2017 - 05 - 09 12: 29: 00 UTC", "end_time": "2017 - 05 - 09 12: 29: 00 UTC" } }] }'; $array = json_decode($json, true); $rawDatas = $array['rawdata'][0]; foreach($rawDatas as $key =>$data) { echo $key."\n......\n"; var_dump($data); echo "............\n"; }
Output for 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, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
task_id1 ...... array(5) { ["apikey1"]=> string(4) "1234" ["flow"]=> string(3) "ssp" ["total_chocolate_request"]=> int(43235) ["start_time"]=> string(29) "2017 - 05 - 09 12: 29: 00 UTC" ["end_time"]=> string(29) "2017 - 05 - 09 12: 29: 00 UTC" } ............ task_id2 ...... array(5) { ["apikey2"]=> string(4) "1235" ["flow"]=> string(9) "mobileweb" ["total_chocolate_request"]=> int(43235) ["start_time"]=> string(29) "2017 - 05 - 09 12: 29: 00 UTC" ["end_time"]=> string(29) "2017 - 05 - 09 12: 29: 00 UTC" } ............
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
170.95 ms | 408 KiB | 5 Q