3v4l.org

run code in 300+ PHP versions simultaneously
<?php $customers='[ { "id": 1, "name": "sara", "phone": 1100, "mobile": 1111 }, { "id": 2, "name": "ben", "phone": 2200, "mobile": 2222 } ]'; $data = json_decode($customers, true); function findCustomerInArr($array,$customerName){ $customerFound = false; foreach($array as $a){ if(strtolower($a['name']) == strtolower($customerName)){ $customerFound = true; echo $customerName."'s phone is ".$a['phone'].PHP_EOL; echo $customerName."'s mobile is ".$a['mobile'].PHP_EOL; break; } } if(false == $customerFound){ echo "No customer found with this name".PHP_EOL; } } findCustomerInArr($data,'sara'); findCustomerInArr($data,'aliveToDie');

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.10.0100.00620.05
8.5.00.0080.01220.14
8.4.150.0030.00014.05
8.4.140.0120.00917.72
8.4.130.0110.00918.64
8.4.120.0110.00924.09
8.4.110.0060.00318.93
8.4.100.0110.01017.59
8.4.90.0110.00922.18
8.4.80.0160.00617.89
8.4.70.0140.00918.72
8.4.60.0090.01118.82
8.4.50.0090.01122.36
8.4.40.0060.00317.76
8.4.30.0140.00720.36
8.4.20.0030.01723.95
8.4.10.0000.00824.17
8.3.280.0100.00918.51
8.3.270.0190.00816.60
8.3.260.0140.00516.48
8.3.250.0120.00718.54
8.3.240.0060.00816.98
8.3.230.0090.00416.66
8.3.220.0090.01117.07
8.3.210.0100.00918.47
8.3.200.0050.00416.42
8.3.190.0120.00717.03
8.3.180.0090.00818.37
8.3.170.0100.00716.92
8.3.160.0060.01216.48
8.3.150.0130.00717.28
8.3.140.0110.00719.11
8.3.130.0060.00318.40
8.3.120.0000.00919.15
8.3.110.0070.00320.94
8.3.100.0080.00024.06
8.3.90.0070.00026.77
8.3.80.0040.00417.97
8.3.70.0090.00616.50
8.3.60.0090.00916.50
8.3.50.0100.01016.59
8.3.40.0110.00620.17
8.3.30.0080.00818.76
8.3.20.0070.00024.18
8.3.10.0000.00724.66
8.3.00.0000.00826.16
8.2.290.0050.00420.36
8.2.280.0110.00718.65
8.2.270.0100.01016.66
8.2.260.0070.01316.48
8.2.250.0040.00418.27
8.2.240.0090.00018.84
8.2.230.0030.00622.58
8.2.220.0050.00337.54
8.2.210.0080.00026.77
8.2.200.0050.00516.38
8.2.190.0110.00418.16
8.2.180.0070.01416.63
8.2.170.0110.00318.86
8.2.160.0070.01022.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0110.00326.16
8.2.120.0040.00419.82
8.2.110.0050.00521.12
8.2.100.0070.00418.16
8.2.90.0000.00819.22
8.2.80.0030.00617.97
8.2.70.0030.00517.75
8.2.60.0040.00418.16
8.2.50.0030.00617.63
8.2.40.0130.00317.62
8.2.30.0120.00617.62
8.2.20.0140.00317.62
8.2.10.0120.00517.63
8.2.00.0050.01017.62
8.1.330.0110.00721.84
8.1.320.0080.01215.91
8.1.310.0140.00416.56
8.1.300.0040.00418.50
8.1.290.0090.00330.84
8.1.280.0040.01125.92
8.1.270.0090.00023.89
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01420.61
8.1.230.0050.00617.82
8.1.220.0020.00517.79
8.1.210.0050.00318.77
8.1.200.0030.00617.25
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0100.00517.62
8.1.160.0150.00417.62
8.1.150.0130.00617.62
8.1.140.0130.00417.62
8.1.130.0100.00517.62
8.1.120.0050.01117.62
8.1.110.0110.00517.62
8.1.100.0130.00317.62
8.1.90.0070.00717.62
8.1.80.0130.00317.62
8.1.70.0140.00317.62
8.1.60.0150.00317.62
8.1.50.0090.00917.62
8.1.40.0140.00517.62
8.1.30.0170.00017.62
8.1.20.0090.00917.62
8.1.10.0170.00017.62
8.1.00.0170.00017.62
8.0.300.0000.00718.77
8.0.290.0000.00816.63
8.0.280.0050.01017.62
8.0.270.0080.01017.62
8.0.260.0100.00717.62
8.0.250.0100.00717.62
8.0.240.0090.00917.62
8.0.230.0160.00017.62
8.0.220.0160.00017.62
8.0.210.0110.00517.62
8.0.200.0110.00517.62
8.0.190.0170.00017.62
8.0.180.0120.00517.62
8.0.170.0120.00317.62
8.0.160.0190.00017.62
8.0.150.0160.00317.62
8.0.140.0110.00717.62
8.0.130.0060.01017.62
8.0.120.0110.00717.62
8.0.110.0110.00717.62
8.0.100.0140.00317.62
8.0.90.0090.00717.62
8.0.80.0130.00417.62
8.0.70.0120.00617.62
8.0.60.0140.00317.62
8.0.50.0090.00917.62
8.0.30.0000.01717.62
8.0.20.0090.00717.62
8.0.10.0120.00417.62

preferences:
116.32 ms | 403 KiB | 5 Q