3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"checks":{"customer_credentials":{"passed":true,"performedAt":"2022-05-14T10:53:25+00:00","payload":{"createdAt":"2022-05-13T21:33:44+00:00"}},"customer_address":{"passed":true,"performedAt":"2022-05-14T10:53:26+00:00","payload":{"createdAt":"2022-05-13T21:33:44+00:00"}},"client_application":{"passed":true,"performedAt":"2022-05-14T10:53:26+00:00","payload":{"applicationId":"cccccccc-0003-cccc-cccc-cccccccccccc","createdAt":"2022-05-13T21:33:45+00:00"}},"application_notification":{"passed":true,"performedAt":"2022-05-14T10:53:26+00:00","payload":{"createdAt":"2022-05-13T21:33:54+00:00"}},"test_notification":{"passed":false,"performedAt":"2022-05-14T10:53:26+00:00"},"payment_countries":{"passed":true,"performedAt":"2022-05-14T10:53:26+00:00","payload":{"countries":["GB","DE","IT","NO","LT","FI","SE","BR"]}},"payment_providers":{"passed":true,"performedAt":"2022-05-14T10:53:26+00:00","payload":{"providers":["Volt","Yapily","Neonomics","Token"]}},"bank_account":{"passed":true,"performedAt":"2022-05-14T10:53:26+00:00","payload":{"createdAt":"2022-05-13T21:33:54+00:00"}},"first_successful_payment":{"passed":false,"performedAt":"2022-05-14T10:53:26+00:00"},"delivered_notification":{"passed":false,"performedAt":"2022-05-14T10:53:26+00:00"}}}'; $data = \json_decode($json, true, 512, JSON_THROW_ON_ERROR); foreach ($data['checks'] as $checkName => $checkData) { var_dump($checkName, $checkData); }
Output for 7.4.0 - 7.4.29, 8.0.1 - 8.0.19, 8.1.0 - 8.1.6
string(20) "customer_credentials" array(3) { ["passed"]=> bool(true) ["performedAt"]=> string(25) "2022-05-14T10:53:25+00:00" ["payload"]=> array(1) { ["createdAt"]=> string(25) "2022-05-13T21:33:44+00:00" } } string(16) "customer_address" array(3) { ["passed"]=> bool(true) ["performedAt"]=> string(25) "2022-05-14T10:53:26+00:00" ["payload"]=> array(1) { ["createdAt"]=> string(25) "2022-05-13T21:33:44+00:00" } } string(18) "client_application" array(3) { ["passed"]=> bool(true) ["performedAt"]=> string(25) "2022-05-14T10:53:26+00:00" ["payload"]=> array(2) { ["applicationId"]=> string(36) "cccccccc-0003-cccc-cccc-cccccccccccc" ["createdAt"]=> string(25) "2022-05-13T21:33:45+00:00" } } string(24) "application_notification" array(3) { ["passed"]=> bool(true) ["performedAt"]=> string(25) "2022-05-14T10:53:26+00:00" ["payload"]=> array(1) { ["createdAt"]=> string(25) "2022-05-13T21:33:54+00:00" } } string(17) "test_notification" array(2) { ["passed"]=> bool(false) ["performedAt"]=> string(25) "2022-05-14T10:53:26+00:00" } string(17) "payment_countries" array(3) { ["passed"]=> bool(true) ["performedAt"]=> string(25) "2022-05-14T10:53:26+00:00" ["payload"]=> array(1) { ["countries"]=> array(8) { [0]=> string(2) "GB" [1]=> string(2) "DE" [2]=> string(2) "IT" [3]=> string(2) "NO" [4]=> string(2) "LT" [5]=> string(2) "FI" [6]=> string(2) "SE" [7]=> string(2) "BR" } } } string(17) "payment_providers" array(3) { ["passed"]=> bool(true) ["performedAt"]=> string(25) "2022-05-14T10:53:26+00:00" ["payload"]=> array(1) { ["providers"]=> array(4) { [0]=> string(4) "Volt" [1]=> string(6) "Yapily" [2]=> string(9) "Neonomics" [3]=> string(5) "Token" } } } string(12) "bank_account" array(3) { ["passed"]=> bool(true) ["performedAt"]=> string(25) "2022-05-14T10:53:26+00:00" ["payload"]=> array(1) { ["createdAt"]=> string(25) "2022-05-13T21:33:54+00:00" } } string(24) "first_successful_payment" array(2) { ["passed"]=> bool(false) ["performedAt"]=> string(25) "2022-05-14T10:53:26+00:00" } string(22) "delivered_notification" array(2) { ["passed"]=> bool(false) ["performedAt"]=> string(25) "2022-05-14T10:53:26+00:00" }

preferences:
26.9 ms | 419 KiB | 5 Q