3v4l.org

run code in 300+ PHP versions simultaneously
<?php $w = date("w"); $array = array( 0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5 ); function find(array $array, $needle) { $last = null; // return value if $pricing array is empty foreach ($array as $key => $value) { if ($key >= $needle) { return $value; } $last = $key; } return $last; } if(in_array($w, $array)) { echo find($array, $w); }

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.60.0040.01418.39
8.3.50.0070.00716.39
8.3.40.0120.00318.84
8.3.30.0150.00718.84
8.3.20.0120.00620.46
8.3.10.0000.00721.73
8.3.00.0040.00422.52
8.2.180.0090.01218.16
8.2.170.0150.00022.96
8.2.160.0070.01022.16
8.2.150.0070.00024.18
8.2.140.0090.00924.66
8.2.130.0040.00419.95
8.2.120.0090.00026.35
8.2.110.0060.00320.89
8.2.100.0090.00318.03
8.2.90.0040.00417.75
8.2.80.0070.00617.97
8.2.70.0080.00017.93
8.2.60.0000.00818.22
8.2.50.0030.00618.10
8.2.40.0080.00020.64
8.2.30.0030.00519.34
8.2.20.0040.00418.06
8.2.10.0030.00519.48
8.2.00.0040.00418.29
8.1.280.0150.00725.92
8.1.270.0000.00820.38
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00022.61
8.1.230.0000.01122.65
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0080.00017.35
8.1.180.0000.00818.10
8.1.170.0050.00318.65
8.1.160.0040.00418.86
8.1.150.0040.00418.87
8.1.140.0000.00720.27
8.1.130.0040.00418.86
8.1.120.0070.00017.48
8.1.110.0000.00717.57
8.1.100.0080.00317.59
8.1.90.0000.00717.48
8.1.80.0070.00017.56
8.1.70.0000.00817.57
8.1.60.0030.00517.53
8.1.50.0030.00617.57
8.1.40.0020.00517.60
8.1.30.0050.00317.72
8.1.20.0040.00417.63
8.1.10.0030.00517.51
8.1.00.0030.00517.43
8.0.300.0000.00819.98
8.0.290.0020.00516.75
8.0.280.0040.00418.39
8.0.270.0000.00717.34
8.0.260.0020.00518.48
8.0.250.0030.00517.10
8.0.240.0080.00017.13
8.0.230.0070.00017.08
8.0.220.0040.00416.98
8.0.210.0030.00317.05
8.0.200.0070.00317.00
8.0.190.0040.00416.92
8.0.180.0000.00817.07
8.0.170.0000.00817.08
8.0.160.0000.00717.05
8.0.150.0030.00616.91
8.0.140.0000.00716.97
8.0.130.0030.00313.30
8.0.120.0030.00616.94
8.0.110.0000.00716.93
8.0.100.0050.00216.89
8.0.90.0070.00017.02
8.0.80.0040.01117.05
8.0.70.0000.00716.96
8.0.60.0070.00016.91
8.0.50.0000.00717.05
8.0.30.0160.00417.17
8.0.20.0040.01517.23
8.0.10.0000.00717.07
8.0.00.0080.01216.78
7.4.330.0000.00415.55
7.4.320.0050.00316.70
7.4.300.0000.00616.58
7.4.290.0030.00316.68
7.4.280.0050.00316.58
7.4.270.0000.00616.59
7.4.260.0000.00716.62
7.4.250.0000.00716.61
7.4.240.0070.00016.72
7.4.230.0040.00416.55
7.4.220.0000.00816.41
7.4.210.0050.01216.63
7.4.200.0040.00416.57
7.4.160.0120.00616.72
7.4.140.0090.00817.86
7.4.130.0100.00716.53
7.4.120.0000.01816.54
7.4.110.0140.00516.72
7.4.100.0070.01116.80
7.4.90.0100.01316.54
7.4.80.0160.00719.39
7.4.70.0180.00016.64
7.4.60.0040.01216.57
7.4.50.0080.00216.36
7.4.40.0120.00616.70
7.4.00.0070.00714.84
7.3.330.0060.00013.42
7.3.320.0000.00513.18
7.3.310.0050.00316.30
7.3.300.0050.00316.30
7.3.290.0000.00716.30
7.3.280.0030.01316.40
7.3.260.0130.00816.62
7.3.240.0130.00416.57
7.3.230.0060.01216.86
7.3.210.0070.01416.64
7.3.200.0090.01216.60
7.3.190.0160.00316.45
7.3.180.0030.01316.38
7.3.170.0110.00716.64
7.3.160.0090.01216.56
7.3.30.0130.00714.96
7.3.20.1300.01015.07
7.3.10.1080.00714.74
7.3.00.1230.00614.84
7.2.330.0080.00816.97
7.2.320.0130.00716.95
7.2.310.0100.00716.90
7.2.300.0070.01016.80
7.2.290.0130.00416.93
7.2.160.0100.01015.19
7.2.150.1400.00614.92
7.2.140.1010.00715.18
7.2.130.1370.00714.89
7.2.120.1280.00315.27
7.2.110.1400.00314.84
7.2.100.1510.00715.21
7.2.90.1340.00715.37
7.2.80.1210.01615.23
7.2.70.1340.00015.29
7.2.60.1850.00015.35
7.2.50.1500.00315.23
7.2.40.1150.00715.26
7.2.30.1310.01015.09
7.2.20.1360.00715.04
7.2.10.1500.01315.33
7.2.00.1380.00315.05
7.1.270.1410.00313.94
7.1.260.1170.00014.20
7.1.250.1270.00014.14

preferences:
71.25 ms | 400 KiB | 5 Q