3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json = ' { "TrackResponse": { "Shipment": { "Package": { "TrackingNumber": "1Z7V015Y6870100000", "Activity": { "ActivityLocation": { "Address": { "City": "Caledon", "StateProvinceCode": "ON", "CountryCode": "CA" } }, "Status": { "Type": "I", "Description": "Departed from Facility", "Code": "DP" }, "Date": "20230322", "Time": "003100" }, "Activity2": [ { "ActivityLocation": { "Address": { "City": "Caledon", "StateProvinceCode": "ON", "CountryCode": "CA" } }, "Status": { "Type": "I", "Description": "Departed from Facility", "Code": "DP" }, "Date": "20230322", "Time": "003100" }, { "ActivityLocation": { "Address": { "City": "Caledon", "StateProvinceCode": "ON", "CountryCode": "CA" } }, "Status": { "Type": "I", "Description": "Arrived at Facility", "Code": "AR" }, "Date": "20230321", "Time": "115000" }, { "ActivityLocation": { "Address": { "City": "Windsor", "StateProvinceCode": "ON", "CountryCode": "CA" } }, "Status": { "Type": "I", "Description": "Departed from Facility", "Code": "DP" }, "Date": "20230320", "Time": "180900" } ] } } } } '; $data = json_decode($json); $activity = $data->TrackResponse->Shipment->Package->Activity; $activity2 = $data->TrackResponse->Shipment->Package->Activity2; if (is_object($activity)) { print_r(' Activity is an object '); } else { print_r(' Activity is NOT an object '); } if (is_array($activity)) { print_r(' Activity is an array '); } else { print_r(' Activity is NOT an array '); } if (is_object($activity2)) { print_r(' Activity2 is an object '); } else { print_r(' Activity2 is NOT an object '); } if (is_array($activity2)) { print_r(' Activity2 is an array '); } else { print_r(' Activity2 is NOT an array '); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.30.0120.00519.61
8.5.20.0090.00720.13
8.5.10.0100.00820.12
8.5.00.0150.00719.99
8.4.180.0120.00822.06
8.4.170.0050.00521.89
8.4.160.0130.01123.82
8.4.150.0060.00616.84
8.4.140.0150.00617.46
8.4.130.0070.01118.71
8.4.120.0050.00423.96
8.4.110.0150.00622.38
8.4.100.0120.00817.61
8.4.90.0130.00818.48
8.4.80.0110.01019.30
8.4.70.0100.01017.85
8.4.60.0110.01018.68
8.4.50.0120.01118.69
8.4.40.0000.00819.38
8.4.30.0000.00918.66
8.4.20.0100.01025.85
8.4.10.0060.00323.93
8.3.300.0110.01020.24
8.3.290.0150.00618.28
8.3.280.0120.00918.27
8.3.270.0110.00916.48
8.3.260.0080.00116.57
8.3.250.0120.00618.95
8.3.240.0140.00517.05
8.3.230.0070.01216.67
8.3.220.0110.00817.01
8.3.210.0120.00720.94
8.3.200.0060.00316.44
8.3.190.0090.01016.76
8.3.180.0130.00618.35
8.3.170.0140.00418.80
8.3.160.0070.00020.16
8.3.150.0110.00417.29
8.3.140.0050.00318.37
8.3.130.0040.00418.30
8.3.120.0040.00418.97
8.3.110.0060.00320.94
8.3.100.0170.00018.58
8.3.90.0080.00026.77
8.3.80.0080.00316.50
8.3.70.0070.01116.63
8.3.60.0100.01016.63
8.3.50.0040.01118.29
8.3.40.0090.00620.21
8.3.30.0110.00318.43
8.3.20.0080.00024.18
8.3.10.0060.00324.66
8.3.00.0040.00426.16
8.2.300.0130.00818.02
8.2.290.0150.00320.04
8.2.280.0110.00816.70
8.2.270.0130.00718.79
8.2.260.0070.01118.90
8.2.250.0050.01016.61
8.2.240.0090.00617.03
8.2.230.0040.00422.58
8.2.220.0080.00024.06
8.2.210.0070.00726.77
8.2.200.0060.00316.75
8.2.190.0070.01416.75
8.2.180.0070.00716.63
8.2.170.0120.00918.91
8.2.160.0070.00722.96
8.2.150.0050.00225.66
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0000.00720.90
8.2.110.0110.00020.54
8.2.100.0120.00017.78
8.2.90.0040.00417.63
8.2.80.0050.00318.61
8.2.70.0040.00417.63
8.2.60.0000.00817.50
8.2.50.0080.00017.55
8.2.40.0050.00518.79
8.2.30.0140.00317.62
8.2.20.0130.00517.62
8.2.10.0130.00417.62
8.2.00.0130.00317.62
8.1.340.0110.00917.47
8.1.330.0130.00623.69
8.1.320.0110.00815.98
8.1.310.0000.00818.27
8.1.300.0000.00918.49
8.1.290.0040.00830.84
8.1.280.0070.00725.92
8.1.270.0000.00824.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0060.00618.87
8.1.220.0050.00317.74
8.1.210.0030.00618.77
8.1.200.0000.00817.10
8.1.190.0040.00417.10
8.1.180.0000.00818.10
8.1.170.0070.00917.62
8.1.160.0050.01117.62
8.1.150.0100.00717.62
8.1.140.0080.00917.62
8.1.130.0090.00717.62
8.1.120.0140.00317.62
8.1.110.0140.00417.62
8.1.100.0130.00517.62
8.1.90.0130.00317.62
8.1.80.0040.01217.62
8.1.70.0160.00117.62
8.1.60.0110.00817.62
8.1.50.0130.00517.62
8.1.40.0140.00417.62
8.1.30.0120.00617.62
8.1.20.0120.00617.62
8.1.10.0140.00617.62
8.1.00.0160.00317.62
8.0.300.0050.00318.84
8.0.290.0050.00316.58
8.0.280.0110.00517.62
8.0.270.0140.00317.62
8.0.260.0110.00617.62
8.0.250.0100.00617.62
8.0.240.0090.00717.62
8.0.230.0140.00317.62
8.0.220.0080.00817.62
8.0.210.0120.00417.62
8.0.200.0140.00317.62
8.0.190.0140.00217.62
8.0.180.0130.00517.62
8.0.170.0090.00717.62
8.0.160.0090.00817.62
8.0.150.0130.00417.62
8.0.140.0180.00017.62
8.0.130.0120.00417.62
8.0.120.0130.00417.62
8.0.110.0090.00717.62
8.0.100.0160.00017.62
8.0.90.0150.00217.62
8.0.80.0150.00317.62
8.0.70.0130.00517.62
8.0.60.0130.00417.62
8.0.50.0120.00417.62
8.0.30.0120.00517.62
8.0.20.0140.00317.62
8.0.10.0160.00017.62
7.4.330.0040.00117.62

preferences:
44.26 ms | 1115 KiB | 5 Q