3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Starting in_array\n"; $limit = 40000; $arr = [30, 367]; $time = microtime(true); for($i = 0; $i < $łimit; ++$i) { if (in_array($i, $arr)) { } } $time = microtime(true) - $time; echo 'in_array() took ' . number_format($time, 3) . " seconds\n"; $time = microtime(true); for($i = 0; $i < $łimit; ++$i) { if ($i === 30 || $i === 367) { } } $time = microtime(true) - $time; echo 'in_array() took ' . number_format($time, 3) . " seconds\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)
7.4.10.0130.00614.91
7.4.00.0090.00915.05
7.3.130.0030.01314.98
7.3.120.0080.01015.05
7.3.110.0080.00914.65
7.3.100.0000.00914.96
7.3.90.0070.00814.56
7.3.80.0090.00614.94
7.3.70.0000.01014.81
7.3.60.0030.01214.88
7.3.50.0040.00814.74
7.3.40.0080.00614.62
7.3.30.0070.00514.89
7.3.20.0050.00716.68
7.3.10.0080.00416.62
7.3.00.0070.00616.63
7.2.260.0030.01415.29
7.2.250.0060.01114.94
7.2.240.0140.00315.21
7.2.230.0060.01114.95
7.2.220.0040.00915.14
7.2.210.0050.00815.22
7.2.200.0090.00515.11
7.2.190.0050.01315.08
7.2.180.0030.01014.95
7.2.170.0050.00815.24
7.2.160.0040.00514.68
7.2.150.0070.01017.13
7.2.140.0030.01516.95
7.2.130.0040.01016.97
7.2.120.0060.00917.00
7.2.110.0090.00616.86
7.2.100.0040.00816.93
7.2.90.0060.00816.78
7.2.80.0040.01016.98
7.2.70.0050.01116.86
7.2.60.0070.00716.91
7.2.50.0080.00716.94
7.2.40.0060.00617.04
7.2.30.0090.00516.89
7.2.20.0070.00616.85
7.2.10.0100.00616.78
7.2.00.0060.00616.89
7.1.330.0050.01015.62
7.1.320.0050.00715.78
7.1.310.0040.00815.84
7.1.300.0080.00715.93
7.1.290.0050.00715.79
7.1.280.0040.00915.86
7.1.270.0070.00615.77
7.1.260.0110.00115.90
7.1.250.0020.00915.77
7.1.240.0020.00815.82
7.1.230.0020.00915.71
7.1.220.0060.00815.84
7.1.210.0050.00915.87
7.1.200.0050.00715.82
7.1.190.0080.00515.81
7.1.180.0050.00415.71
7.1.170.0080.00615.74
7.1.160.0030.00815.88
7.1.150.0050.00615.51
7.1.140.0100.00515.71
7.1.130.0090.00515.74
7.1.120.0040.00415.58
7.1.110.0080.00515.85
7.1.100.0020.01215.98
7.1.90.0070.00615.73
7.1.80.0030.00815.70
7.1.70.0030.00916.22
7.1.60.0040.01217.07
7.1.50.0090.00815.87
7.1.40.0060.00915.84
7.1.30.0050.00915.64
7.1.20.0050.00615.89
7.1.10.0040.01415.72
7.1.00.0050.02917.90
7.0.330.0090.00415.31
7.0.320.0020.01115.38
7.0.310.0050.00715.31
7.0.300.0070.00415.33
7.0.290.0080.00515.35
7.0.280.0100.00615.26
7.0.270.0070.00515.20
7.0.260.0030.00615.22
7.0.250.0020.01115.41
7.0.240.0050.01015.46
7.0.230.0020.01115.16
7.0.220.0040.00715.40
7.0.210.0080.00615.32
7.0.200.0060.00615.76
7.0.190.0050.01015.42
7.0.180.0080.00515.41
7.0.170.0040.00715.25
7.0.160.0070.00715.40
7.0.150.0110.00215.35
7.0.140.0050.02717.68
7.0.130.0020.01015.38
7.0.120.0050.00915.35
7.0.110.0020.03016.98
7.0.100.0090.02916.83
7.0.90.0050.03416.93
7.0.80.0030.02116.96
7.0.70.0050.02916.91
7.0.60.0050.03116.86
7.0.50.0060.03317.25
7.0.40.0050.03415.74
7.0.30.0080.02915.73
7.0.20.0080.03415.64
7.0.10.0060.02315.69
7.0.00.0070.03115.56
5.6.400.0130.00314.35
5.6.390.0120.00313.83
5.6.380.0050.00714.27
5.6.370.0100.00614.15
5.6.360.0070.00414.43
5.6.350.0060.00614.34
5.6.340.0030.01114.26
5.6.330.0090.00614.34
5.6.320.0080.00814.11
5.6.310.0030.01014.36
5.6.300.0040.01014.50
5.6.290.0050.00714.41
5.6.280.0010.03116.76
5.6.270.0000.01214.46
5.6.260.0060.02116.45
5.6.250.0070.02216.40
5.6.240.0070.03116.42
5.6.230.0070.03216.36
5.6.220.0080.03216.29
5.6.210.0070.02416.41
5.6.200.0040.03716.40
5.6.190.0060.02516.57
5.6.180.0050.03316.68
5.6.170.0100.03116.52
5.6.160.0070.03116.51
5.6.150.0060.03516.66
5.6.140.0070.02116.44
5.6.130.0070.03216.41
5.6.120.0060.03316.40
5.6.110.0080.03016.49
5.6.100.0170.02016.58
5.6.90.0100.02816.52
5.6.80.0050.03016.35
5.6.70.0070.02816.30
5.6.60.0050.02316.28
5.6.50.0100.02816.21
5.6.40.0050.02516.22
5.6.30.0020.03016.30
5.6.20.0080.02816.32
5.6.10.0050.03316.36
5.6.00.0080.01916.43
5.5.380.0040.03015.28
5.5.370.0030.03315.35
5.5.360.0060.03015.29
5.5.350.0060.02915.21
5.5.340.0060.03115.40
5.5.330.0110.02615.34
5.5.320.0070.03115.33
5.5.310.0050.03215.43
5.5.300.0020.02315.43
5.5.290.0060.02115.54
5.5.280.0060.03415.46
5.5.270.0120.02615.49
5.5.260.0070.03015.42
5.5.250.0060.03015.38
5.5.240.0100.02615.18
5.5.230.0060.02015.27
5.5.220.0040.02915.25
5.5.210.0050.03315.28
5.5.200.0060.03015.15
5.5.190.0050.03315.16
5.5.180.0060.02815.25
5.5.170.0020.00812.59
5.5.160.0080.03115.25
5.5.150.0050.02915.20
5.5.140.0040.03215.26
5.5.130.0100.02715.21
5.5.120.0060.02215.30
5.5.110.0100.02815.15
5.5.100.0060.02415.27
5.5.90.0080.01515.19
5.5.80.0060.02915.15
5.5.70.0060.02915.13
5.5.60.0060.02615.26
5.5.50.0080.02715.09
5.5.40.0070.02515.07
5.5.30.0120.02315.06
5.5.20.0080.01515.20
5.5.10.0040.03215.07
5.5.00.0060.02715.03
5.4.450.0080.02814.25
5.4.440.0040.02614.22
5.4.430.0050.03014.18
5.4.420.0100.02214.24
5.4.410.0050.03114.17
5.4.400.0090.02514.07
5.4.390.0040.03414.11
5.4.380.0080.02814.05
5.4.370.0050.02214.04
5.4.360.0060.02614.14
5.4.350.0080.02314.08
5.4.340.0080.01614.08
5.4.330.0050.00511.58
5.4.320.0030.03114.08
5.4.310.0050.03014.08
5.4.300.0090.02214.07
5.4.290.0080.02414.10
5.4.280.0070.02914.04
5.4.270.0030.01914.08
5.4.260.0060.01414.08
5.4.250.0070.02714.07
5.4.240.0030.03014.11
5.4.230.0040.02814.07
5.4.220.0070.02914.08
5.4.210.0060.02814.08
5.4.200.0030.03014.07
5.4.190.0070.01814.11
5.4.180.0060.03014.07
5.4.170.0040.03114.07
5.4.160.0060.02014.06
5.4.150.0060.02814.10
5.4.140.0060.02513.14
5.4.130.0070.02813.22
5.4.120.0040.02813.13
5.4.110.0000.03213.22
5.4.100.0030.03213.13
5.4.90.0030.02613.21
5.4.80.0040.02913.21
5.4.70.0050.02913.20
5.4.60.0040.02713.21
5.4.50.0050.02513.22
5.4.40.0010.02213.20
5.4.30.0060.02713.20
5.4.20.0070.02413.20
5.4.10.0030.03113.19
5.4.00.0100.01512.97
5.3.290.0060.02712.57
5.3.280.0060.02112.62
5.3.270.0070.02812.57
5.3.260.0030.03212.62
5.3.250.0030.02012.61
5.3.240.0050.02512.55
5.3.230.0060.02512.56
5.3.220.0030.02812.54
5.3.210.0040.02812.52
5.3.200.0070.02212.57
5.3.190.0070.02712.55
5.3.180.0020.02012.52
5.3.170.0060.03112.57
5.3.160.0040.03012.52
5.3.150.0070.03012.57
5.3.140.0020.03112.55
5.3.130.0020.02412.59
5.3.120.0060.03012.53
5.3.110.0050.03012.57
5.3.100.0030.03112.36
5.3.90.0070.02712.33
5.3.80.0010.03412.40
5.3.70.0030.03012.39
5.3.60.0080.02012.31
5.3.50.0040.02812.39
5.3.40.0110.02412.31
5.3.30.0040.02412.31
5.3.20.0030.02212.29
5.3.10.0030.02612.24
5.3.00.0040.02412.29
5.2.170.0030.02311.61
5.2.160.0040.03211.61
5.2.150.0050.03011.61
5.2.140.0060.03111.61
5.2.130.0030.03211.61
5.2.120.0020.03511.61
5.2.110.0090.02311.61
5.2.100.0070.03211.61
5.2.90.0030.03011.61
5.2.80.0050.02011.61
5.2.70.0050.02911.61
5.2.60.0020.03711.61
5.2.50.0030.03011.61
5.2.40.0080.02811.61
5.2.30.0060.03211.61
5.2.20.0030.02111.61
5.2.10.0060.03011.61
5.2.00.0100.01311.61
5.1.60.0030.02911.61
5.1.50.0050.02211.61
5.1.40.0050.02311.61
5.1.30.0050.01611.61
5.1.20.0000.03311.61
5.1.10.0030.02211.61
5.1.00.0050.02811.61
5.0.50.0020.02711.61
5.0.40.0030.02211.61
5.0.30.0020.02311.61
5.0.20.0040.01811.61
5.0.10.0030.02211.61
5.0.00.0050.02911.61
4.4.90.0010.02011.61
4.4.80.0030.01711.61
4.4.70.0020.01911.61
4.4.60.0080.01311.61
4.4.50.0020.02111.61
4.4.40.0050.02611.61
4.4.30.0000.01411.61
4.4.20.0030.01811.61
4.4.10.0020.02011.61
4.4.00.0030.02711.61
4.3.110.0040.01211.61
4.3.100.0020.01511.61
4.3.90.0020.01711.61
4.3.80.0000.02911.61
4.3.70.0030.01111.61
4.3.60.0020.01811.61
4.3.50.0020.01811.61
4.3.40.0030.02011.61
4.3.30.0040.01711.61
4.3.20.0030.01611.61
4.3.10.0050.01511.61
4.3.00.0010.01611.61

preferences:
35.82 ms | 401 KiB | 5 Q