3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '{"Body": {"stkCallback": {"MerchantRequestID":"26452-605723-2","CheckoutRequestID":"ws_CO_23042018105859659","ResultCode":0,"ResultDesc":"The service request is processed successfully.","CallbackMetadata": {"Item":[{"Name":"Amount","Value":1.00},{"Name":"MpesaReceiptNumber","Value":"MDN6ZJE4XG"},{"Name":"Balance"},{"Name":"TransactionDate","Value":20180423105912},{"Name":"PhoneNumber","Value":254722200121}]}}}}'; $arr = json_decode($str,true); echo $arr['Body']['stkCallback']['MerchantRequestID'] . "\n"; // Working Foreach($arr['Body']['stkCallback']['CallbackMetadata']['Item'] as $subarr){ Foreach($subarr as $item){ Echo $item ."\n"; } }

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.4.120.0140.00724.10
8.4.110.0130.00718.80
8.4.100.0100.01017.66
8.4.90.0130.00718.59
8.4.80.0100.01017.75
8.4.70.0120.01017.53
8.4.60.0110.00918.76
8.4.50.0030.00619.51
8.4.40.0060.01319.39
8.4.30.0140.00717.56
8.4.20.0070.01319.39
8.4.10.0100.00617.69
8.3.250.0110.00818.80
8.3.240.0090.01017.21
8.3.230.0130.00716.78
8.3.220.0040.00317.08
8.3.210.0100.00718.16
8.3.200.0090.00216.63
8.3.190.0140.00717.28
8.3.180.0050.00416.25
8.3.170.0070.01117.05
8.3.160.0060.00316.61
8.3.150.0140.00420.68
8.3.140.0120.00317.28
8.3.130.0000.00818.49
8.3.120.0060.00619.01
8.3.110.0120.00320.94
8.3.100.0090.00616.75
8.3.90.0080.00016.39
8.3.80.0090.00017.97
8.3.70.0100.01016.63
8.3.60.0140.00418.55
8.3.50.0060.00718.15
8.3.40.0090.00618.71
8.3.30.0110.00418.76
8.3.20.0070.00021.91
8.3.10.0080.00021.85
8.3.00.0060.00319.68
8.2.290.0130.00620.47
8.2.280.0050.00318.65
8.2.270.0080.00017.25
8.2.260.0070.01120.18
8.2.250.0070.00716.80
8.2.240.0100.00716.98
8.2.230.0000.00822.58
8.2.220.0140.00424.06
8.2.210.0070.00726.77
8.2.200.0030.00616.75
8.2.190.0110.00417.00
8.2.180.0160.00616.50
8.2.170.0000.01922.96
8.2.160.0120.00322.31
8.2.150.0050.00324.18
8.2.140.0030.00624.66
8.2.130.0080.00019.38
8.2.120.0040.00426.35
8.2.110.0030.00621.13
8.2.100.0090.00317.84
8.2.90.0060.00317.90
8.2.80.0000.00918.21
8.2.70.0040.00417.93
8.2.60.0040.00418.03
8.2.50.0040.00418.18
8.2.40.0040.00420.55
8.2.30.0030.00619.44
8.2.20.0040.00418.18
8.2.10.0000.00818.13
8.2.00.0000.00818.12
8.1.330.0100.00722.09
8.1.320.0120.00616.27
8.1.310.0000.00816.42
8.1.300.0030.00619.80
8.1.290.0060.00318.88
8.1.280.0090.00625.92
8.1.270.0030.00623.99
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0090.00023.97
8.1.230.0080.00321.03
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0000.00817.23
8.1.190.0000.01017.23
8.1.180.0050.00318.10
8.1.170.0050.00318.61
8.1.160.0040.00418.89
8.1.150.0020.00520.81
8.1.140.0040.00417.75
8.1.130.0040.00417.33
8.1.120.0070.00017.36
8.1.110.0100.00017.29
8.1.100.0000.01017.43
8.1.90.0060.00317.46
8.1.80.0000.00717.36
8.1.70.0000.00717.46
8.1.60.0050.00517.57
8.1.50.0080.00017.36
8.1.40.0040.00417.48
8.1.30.0040.00417.55
8.1.20.0040.00417.69
8.1.10.0030.00617.52
8.1.00.0040.00417.52
8.0.300.0050.00219.98
8.0.290.0030.00616.61
8.0.280.0040.00418.50
8.0.270.0070.00017.26
8.0.260.0000.00616.81
8.0.250.0030.00316.97
8.0.240.0080.00316.86
8.0.230.0040.00416.91
8.0.220.0080.00316.88
8.0.210.0070.00016.86
8.0.200.0030.00316.88
8.0.190.0040.00416.89
8.0.180.0000.00716.93
8.0.170.0080.00016.91
8.0.160.0080.00016.89
8.0.150.0000.00716.68
8.0.140.0070.00016.87
8.0.130.0060.00013.36
8.0.120.0070.00016.89
8.0.110.0040.00416.93
8.0.100.0070.00016.84
8.0.90.0070.00016.83
8.0.80.0100.00616.93
8.0.70.0050.00216.69
8.0.60.0000.00716.90
8.0.50.0040.00416.89
8.0.30.0120.00717.21
8.0.20.0120.00617.44
8.0.10.0000.00716.89
8.0.00.0090.00916.79
7.4.330.0050.00016.80
7.4.320.0030.00316.51
7.4.300.0000.00716.57
7.4.290.0040.00416.50
7.4.280.0040.00416.41
7.4.270.0070.00016.46
7.4.260.0000.00716.52
7.4.250.0070.00016.36
7.4.240.0040.00416.54
7.4.230.0030.00316.32
7.4.220.0030.00516.50
7.4.210.0060.00816.55
7.4.200.0000.00716.61
7.4.160.0100.00616.52
7.4.140.0110.00717.86
7.4.130.0130.00616.45
7.4.120.0140.00516.54
7.4.110.0130.00816.45
7.4.100.0100.01316.72
7.4.90.0160.00716.57
7.4.80.0070.01119.39
7.4.70.0130.00916.50
7.4.60.0060.00916.37
7.4.50.0070.00716.63
7.4.40.0130.00316.58
7.4.00.0080.00614.89
7.3.330.0050.00013.16
7.3.320.0030.00213.16
7.3.310.0000.00816.40
7.3.300.0030.00316.21
7.3.290.0030.00416.32
7.3.280.0060.01116.31
7.3.260.0090.01016.35
7.3.240.0100.00816.43
7.3.230.0090.00916.40
7.3.210.0110.01216.31
7.3.200.0110.00616.49
7.3.190.0070.01016.38
7.3.180.0070.01016.68
7.3.170.0090.00916.39
7.3.160.0100.01016.36
7.2.330.0060.01216.66
7.2.320.0070.01116.66
7.2.310.0080.01516.55
7.2.300.0110.00716.49
7.2.290.0090.00916.56
7.2.60.0060.00617.04
7.2.50.0110.00017.05
7.2.40.0730.01217.89
7.2.30.1360.01317.79
7.2.20.1440.01118.11
7.2.10.1570.01418.23
7.2.00.0960.01117.92
7.1.200.0090.00615.90
7.1.160.0770.00916.94
7.1.150.1200.01017.00
7.1.140.1400.01516.82
7.1.130.1110.01016.56
7.1.120.2010.00817.05
7.1.110.1280.00916.23
7.1.100.0810.01116.25
7.1.90.1500.01216.37
7.1.80.1290.01515.88
7.1.70.1380.01115.30
7.1.60.1600.01333.17
7.1.50.1530.01532.91
7.1.40.1470.01632.56
7.1.30.1420.01732.70
7.1.20.1340.01632.54
7.1.10.1420.01114.69
7.1.00.1210.01014.76

preferences:
29.32 ms | 403 KiB | 5 Q