3v4l.org

run code in 500+ PHP versions simultaneously
<?php $customers='[ { "id": 1, "name": "sara", "phone": 1100, "mobile": 1111 }, { "id": 2, "name": "ben", "phone": 2200, "mobile": 2222 } ]'; foreach(json_decode($customers, true) as $a){ if($a['name'] == 'sara'){ $phone = $a['phone']; $mobile = $a['mobile']; echo "sara's phone is $phone"; echo "sara's mobile is $mobile"; } else{ echo "No customer found with this name"; } }

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.0090.00819.39
8.5.20.0110.00820.21
8.5.10.0090.00820.15
8.5.00.0090.01321.91
8.4.180.0150.00623.89
8.4.170.0120.00923.77
8.4.160.0150.00724.57
8.4.150.0070.00516.83
8.4.140.0140.01017.58
8.4.130.0100.01017.68
8.4.120.0120.00720.54
8.4.110.0130.00722.58
8.4.100.0060.00517.70
8.4.90.0140.00717.80
8.4.80.0050.00321.02
8.4.70.0100.00917.50
8.4.60.0100.01117.63
8.4.50.0150.00619.52
8.4.40.0080.00017.67
8.4.30.0130.00620.51
8.4.20.0100.01024.11
8.4.10.0100.01023.85
8.3.300.0110.01018.38
8.3.290.0140.00718.37
8.3.280.0110.00918.41
8.3.270.0120.00816.45
8.3.260.0100.00516.68
8.3.250.0110.00718.58
8.3.240.0120.00616.85
8.3.230.0130.00616.61
8.3.220.0090.00919.00
8.3.210.0160.00516.79
8.3.200.0110.00916.72
8.3.190.0040.00618.38
8.3.180.0100.00916.71
8.3.170.0150.00318.73
8.3.160.0100.01016.71
8.3.150.0110.00419.16
8.3.140.0120.00617.00
8.3.130.0040.00418.31
8.3.120.0040.00418.84
8.3.110.0080.00018.43
8.3.100.0030.00618.22
8.3.90.0040.00426.77
8.3.80.0080.00818.40
8.3.70.0070.00716.25
8.3.60.0040.01116.38
8.3.50.0100.01018.53
8.3.40.0150.00420.17
8.3.30.0070.00718.70
8.3.20.0000.00724.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.300.0130.00718.13
8.2.290.0090.00920.51
8.2.280.0140.00516.62
8.2.270.0040.00417.04
8.2.260.0120.00316.65
8.2.250.0030.00516.81
8.2.240.0110.00717.26
8.2.230.0050.00320.94
8.2.220.0090.00024.06
8.2.210.0040.01426.77
8.2.200.0030.00718.25
8.2.190.0120.00316.63
8.2.180.0100.01016.38
8.2.170.0150.00018.83
8.2.160.0110.00322.96
8.2.150.0020.00525.66
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0000.00919.38
8.2.100.0130.00018.03
8.2.90.0050.00319.17
8.2.80.0000.00817.97
8.2.70.0000.00817.61
8.2.60.0030.00517.63
8.2.50.0060.00317.55
8.2.40.0030.00617.62
8.2.30.0080.00817.62
8.2.20.0070.00317.75
8.2.10.0140.00317.62
8.2.00.0100.00517.62
8.1.340.0140.00617.51
8.1.330.0120.00623.84
8.1.320.0110.00916.13
8.1.310.0070.00718.22
8.1.300.0000.00817.74
8.1.290.0120.00030.84
8.1.280.0070.00725.92
8.1.270.0080.00024.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00322.06
8.1.230.0110.00017.82
8.1.220.0080.00017.78
8.1.210.0040.00418.77
8.1.200.0030.00517.35
8.1.190.0040.00417.10
8.1.180.0030.00518.10
8.1.170.0170.00417.62
8.1.160.0070.00917.62
8.1.150.0130.00617.62
8.1.140.0120.00617.62
8.1.130.0130.00517.62
8.1.120.0150.00417.62
8.1.110.0110.00817.62
8.1.100.0080.00817.62
8.1.90.0120.00317.62
8.1.80.0100.00717.62
8.1.70.0110.00517.62
8.1.60.0140.00417.62
8.1.50.0150.00417.62
8.1.40.0150.00217.62
8.1.30.0130.00717.62
8.1.20.0160.00317.62
8.1.10.0160.00317.62
8.1.00.0160.00417.62
8.0.300.0070.00018.77
8.0.290.0030.00616.75
8.0.280.0140.00317.62
8.0.270.0150.00217.62
8.0.260.0100.00717.62
8.0.250.0170.00017.62
8.0.240.0130.00317.62
8.0.230.0180.00017.62
8.0.220.0110.00417.62
8.0.210.0100.00717.62
8.0.200.0120.00417.62
8.0.190.0040.01217.62
8.0.180.0060.01017.62
8.0.170.0130.00417.62
8.0.160.0120.00417.62
8.0.150.0120.00617.62
8.0.140.0160.00017.62
8.0.130.0110.00417.62
8.0.120.0100.00717.62
8.0.110.0110.00517.62
8.0.100.0080.00817.62
8.0.90.0120.00417.62
8.0.80.0080.00817.62
8.0.70.0160.00017.62
8.0.60.0160.00017.62
8.0.50.0150.00017.62
8.0.30.0120.00417.62
8.0.20.0090.00917.62
8.0.10.0100.00517.62

preferences:
43.81 ms | 1108 KiB | 5 Q