3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users = [ "4" => "John", "7" => "Alex", "13" => "Smith", "95" => "Taylor" ]; $id = 9; $nearestUserByIdInReverseOrder = false; foreach($users as $userId => $name) { if($id >= $userId) { $nearestUserByIdInReverseOrder = $name; } } echo $nearestUserByIdInReverseOrder;

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.3.70.0160.00716.58
8.3.60.0120.00918.39
8.3.50.0060.00918.26
8.3.40.0030.01518.71
8.3.30.0080.00618.48
8.3.20.0040.00424.18
8.3.10.0050.00224.66
8.3.00.0070.00026.16
8.2.190.0140.00716.63
8.2.180.0100.00725.92
8.2.170.0090.00618.82
8.2.160.0000.01322.96
8.2.150.0040.00425.66
8.2.140.0000.00724.66
8.2.130.0030.00626.16
8.2.120.0040.00420.52
8.2.110.0060.00322.30
8.2.100.0040.00817.84
8.2.90.0080.00019.28
8.2.80.0000.00817.97
8.2.70.0090.00017.63
8.2.60.0030.00617.63
8.2.50.0100.00017.55
8.2.40.0040.00419.52
8.2.30.0060.00319.32
8.2.20.0000.00718.13
8.2.10.0040.00419.37
8.2.00.0000.00719.32
8.1.280.0170.00325.92
8.1.270.0050.00324.66
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00023.96
8.1.230.0040.00719.05
8.1.220.0050.00317.75
8.1.210.0000.00818.77
8.1.200.0020.01017.13
8.1.190.0030.00517.36
8.1.180.0030.00618.10
8.1.170.0040.00417.62
8.1.160.0090.00019.03
8.1.150.0050.00218.89
8.1.140.0000.00918.84
8.1.130.0000.00820.13
8.1.120.0040.00417.54
8.1.110.0110.00017.44
8.1.100.0030.00617.51
8.1.90.0030.00617.34
8.1.80.0100.00017.52
8.1.70.0000.00717.36
8.1.60.0030.00617.57
8.1.50.0040.00417.41
8.1.40.0050.00217.53
8.1.30.0000.00817.55
8.1.20.0050.00317.54
8.1.10.0030.00617.52
8.1.00.0080.00317.50
8.0.300.0040.00418.77
8.0.290.0080.00017.16
8.0.280.0070.00018.46
8.0.270.0070.00016.76
8.0.260.0000.00718.36
8.0.250.0040.00416.88
8.0.240.0030.00616.84
8.0.230.0000.00716.92
8.0.220.0000.00716.83
8.0.210.0070.00016.88
8.0.200.0040.00416.96
8.0.190.0060.00316.83
8.0.180.0000.00716.92
8.0.170.0030.00616.88
8.0.160.0050.00316.95
8.0.150.0100.00016.73
8.0.140.0030.00616.76
8.0.130.0050.00013.33
8.0.120.0050.00216.83
8.0.110.0030.00516.69
8.0.100.0050.00316.78
8.0.90.0070.00016.90
8.0.80.0060.01016.82
8.0.70.0040.00416.80
8.0.60.0040.00416.75
8.0.50.0000.00817.01
8.0.30.0030.01317.07
8.0.20.0080.01517.03
8.0.10.0000.00716.91
8.0.00.0180.00616.64
7.4.330.0020.00215.55
7.4.320.0000.00616.43
7.4.300.0030.00316.59
7.4.290.0000.00716.44
7.4.280.0000.00916.41
7.4.270.0030.00316.59
7.4.260.0070.00013.22
7.4.250.0000.00816.52
7.4.240.0060.00316.45
7.4.230.0070.00016.67
7.4.220.0030.00316.40
7.4.210.0080.00716.61
7.4.200.0000.00816.48
7.4.130.0120.00916.46
7.4.120.0090.01216.58
7.4.110.0030.01316.59
7.4.100.0030.01516.52
7.4.90.0120.00816.17
7.4.80.0100.01016.48
7.4.70.0120.00816.41
7.4.60.0100.01116.34
7.4.50.0070.01316.46
7.4.40.0120.00716.29
7.4.30.0120.00916.50
7.4.20.0100.01116.46
7.4.10.0090.01116.33
7.4.00.0090.01016.49
7.3.330.0000.00716.35
7.3.320.0050.00013.25
7.3.310.0070.00016.41
7.3.300.0030.00316.16
7.3.290.0040.01016.40
7.3.260.0160.00816.36
7.3.230.0140.00316.46
7.3.210.0110.00916.36
7.3.200.0110.00916.40
7.3.190.0090.01016.37
7.3.180.0100.00916.37
7.3.170.0110.00816.42
7.3.160.0090.01016.28
7.3.150.0100.00916.36
7.3.140.0090.01016.45
7.3.130.0120.00816.41
7.3.120.0100.00916.35
7.3.110.0130.00816.31
7.3.100.0120.00816.35
7.3.90.0100.01016.36
7.3.80.0110.00916.39
7.3.70.0100.01116.33
7.3.60.0110.00816.39
7.3.50.0100.01016.32
7.3.40.0110.00916.35
7.3.30.0080.01116.36
7.3.20.0110.00816.35
7.3.10.0100.00916.36
7.3.00.0100.01016.30
7.2.330.0090.01016.52
7.2.320.0110.00916.57
7.2.310.0110.00816.59
7.2.300.0100.00916.53
7.2.290.0090.01216.62
7.2.280.0100.01016.52
7.2.270.0140.00616.51
7.2.260.0080.01216.47
7.2.250.0100.01016.48
7.2.240.0100.01116.52
7.2.230.0110.01016.53
7.2.220.0110.00916.46
7.2.210.0100.01116.58
7.2.200.0120.00816.59
7.2.190.0130.00816.47
7.2.180.0090.01116.51
7.2.170.0100.01016.50
7.2.160.0080.01116.53
7.2.150.0130.00816.61
7.2.140.0110.00916.57
7.2.130.0110.00916.61
7.2.120.0090.01216.56
7.2.110.0120.00916.60
7.2.100.0100.01016.56
7.2.90.0110.01116.58
7.2.80.0110.01116.58
7.2.70.0120.00916.54
7.2.60.0110.01016.60
7.2.50.0110.01016.62
7.2.40.0150.00716.62
7.2.30.0120.00916.61
7.2.20.0130.00916.58
7.2.10.0100.00916.54
7.2.00.0150.00816.57

preferences:
65.87 ms | 404 KiB | 6 Q