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 < $limit; ++$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 < $limit; ++$i) { if ($i === 30 || $i === 367) { } } $time = microtime(true) - $time; echo '=== 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.2.00.0030.01219.32
7.1.70.0060.00317.21
7.1.60.0140.00719.70
7.1.50.0040.01817.14
7.1.00.0070.07322.40
7.0.200.0000.01316.97
7.0.140.0100.07022.15
7.0.60.0070.08019.94
7.0.50.0000.04717.87
7.0.40.0070.06319.98
7.0.30.0430.04720.20
7.0.20.0200.05020.19
7.0.10.0070.04320.00
7.0.00.0030.04320.13
5.6.280.0130.07721.15
5.6.210.0130.07320.56
5.6.200.0070.07018.11
5.6.190.0130.09020.61
5.6.180.0200.09320.47
5.6.170.0130.06020.56
5.6.160.0030.04720.38
5.6.150.0070.06718.16
5.6.140.0070.08318.14
5.6.130.0070.04318.10
5.6.120.0100.06720.99
5.6.110.0070.05721.09
5.6.100.0030.06321.11
5.6.90.0070.07020.96
5.6.80.0130.08320.50
5.6.70.4130.03720.43
5.5.350.0030.06020.30
5.5.340.0100.08717.99
5.5.330.0100.06320.36
5.5.320.0200.07320.51
5.5.310.0270.09020.35
5.5.300.0000.04717.96
5.5.290.0030.10317.91
5.5.280.0070.09720.89
5.5.270.0070.07720.86
5.5.260.0200.08020.89
5.5.250.0070.09320.68
5.5.240.0400.05320.35
5.4.450.0270.06334.83
5.4.440.0000.05333.05
5.4.430.0200.06032.19
5.4.420.0400.04332.19
5.4.410.0170.05332.19
5.4.400.0400.05332.19
5.4.390.0500.05331.83
5.4.380.0270.07018.59
5.4.370.0500.06318.59
5.4.360.0330.06018.48
5.4.350.0330.06718.60
5.4.340.0430.06318.60
5.4.320.0080.05012.46
5.4.310.0090.05012.45
5.4.300.0080.05012.46
5.4.290.0060.05412.45
5.4.280.0040.04812.36
5.4.270.0040.05012.35
5.4.260.0060.04912.36
5.4.250.0110.04712.36
5.4.240.0080.04812.35
5.4.230.0050.05412.35
5.4.220.0060.04712.35
5.4.210.0080.04512.35
5.4.200.0090.04612.34
5.4.190.0100.04512.34
5.4.180.0080.04912.34
5.4.170.0050.05112.35
5.4.160.0040.04812.35
5.4.150.0040.04712.35
5.4.140.0060.04412.03
5.4.130.0090.05012.02
5.4.120.0080.04811.98
5.4.110.0070.05011.97
5.4.100.0060.04611.98
5.4.90.0100.04511.97
5.4.80.0120.06111.97
5.4.70.0070.04711.97
5.4.60.0060.04611.97
5.4.50.0070.05111.97
5.4.40.0050.06411.95
5.4.30.0080.04911.95
5.4.20.0120.06811.95
5.4.10.0110.06011.96
5.4.00.0070.05011.45
5.3.290.0100.04112.80
5.3.280.0090.03612.71
5.3.270.0060.04312.73
5.3.260.0060.04412.72
5.3.250.0050.04912.72
5.3.240.0130.04812.72
5.3.230.0070.04312.71
5.3.220.0090.05012.68
5.3.210.0060.05512.68
5.3.200.0120.04412.68
5.3.190.0130.04912.68
5.3.180.0100.04912.67
5.3.170.0060.05112.67
5.3.160.0110.03412.67
5.3.150.0080.03712.67
5.3.140.0070.03512.66
5.3.130.0080.03712.66
5.3.120.0090.03812.66
5.3.110.0040.04212.66
5.3.100.0120.03212.12
5.3.90.0040.03912.08
5.3.80.0080.03412.07
5.3.70.0040.03812.07
5.3.60.0060.03912.07
5.3.50.0060.03712.00
5.3.40.0060.03712.00
5.3.30.0060.03511.95
5.3.20.0080.03311.73
5.3.10.0040.03711.70
5.3.00.0080.03711.68
5.2.170.0090.0339.18
5.2.160.0060.0299.18
5.2.150.0060.0319.18
5.2.140.0090.0319.18
5.2.130.0080.0289.14
5.2.120.0060.0329.14
5.2.110.0060.0289.14
5.2.100.0050.0289.14
5.2.90.0060.0289.14
5.2.80.0070.0289.14
5.2.70.0020.0339.13
5.2.60.0050.0299.09
5.2.50.0040.0319.06
5.2.40.0080.0279.04
5.2.30.0070.0279.02
5.2.20.0040.0309.00
5.2.10.0050.0278.92
5.2.00.0070.0348.78
5.1.60.0070.0278.07
5.1.50.0070.0328.06
5.1.40.0040.0258.05
5.1.30.0050.0268.40
5.1.20.0050.0278.42
5.1.10.0080.0228.14
5.1.00.0020.0298.14
5.0.50.0030.0216.63
5.0.40.0050.0186.48
5.0.30.0030.0326.30
5.0.20.0070.0216.26
5.0.10.0090.0166.24
5.0.00.0040.0316.23
4.4.90.0040.0174.78
4.4.80.0050.0214.75
4.4.70.0080.0144.75
4.4.60.0030.0154.76
4.4.50.0020.0164.77
4.4.40.0010.0274.71
4.4.30.0030.0164.76
4.4.20.0030.0154.85
4.4.10.0030.0164.85
4.4.00.0040.0254.76
4.3.110.0050.0144.67
4.3.100.0020.0164.67
4.3.90.0050.0134.63
4.3.80.0060.0214.58
4.3.70.0040.0144.63
4.3.60.0030.0164.63
4.3.50.0040.0164.63
4.3.40.0080.0334.54
4.3.30.0030.0183.29
4.3.20.0020.0173.26
4.3.10.0020.0173.22
4.3.00.0030.01731.67

preferences:
36.18 ms | 400 KiB | 5 Q