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 '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.0070.01415.03
7.4.00.0090.01315.01
7.3.130.0100.01314.88
7.3.120.0090.01014.92
7.3.110.0050.01314.93
7.3.100.0020.01614.69
7.3.90.0050.01214.95
7.3.80.0050.01014.91
7.3.70.0030.01314.88
7.3.60.0080.01114.84
7.3.50.0070.01014.73
7.3.40.0020.01514.86
7.3.30.0040.01214.70
7.3.20.0030.01616.48
7.3.10.0060.01016.52
7.3.00.0060.00816.76
7.2.260.0070.01814.83
7.2.250.0050.01715.25
7.2.240.0030.01515.05
7.2.230.0070.01114.82
7.2.220.0080.01014.97
7.2.210.0070.01114.92
7.2.200.0060.01115.12
7.2.190.0080.01214.99
7.2.180.0060.01014.99
7.2.170.0050.01515.07
7.2.160.0020.01315.03
7.2.150.0040.01016.98
7.2.140.0020.01616.70
7.2.130.0070.00717.04
7.2.120.0060.00916.72
7.2.110.0070.01116.92
7.2.100.0060.01016.84
7.2.90.0070.01216.70
7.2.80.0070.01117.01
7.2.70.0040.01216.89
7.2.60.0070.01017.03
7.2.50.0030.01517.01
7.2.40.0050.01516.94
7.2.30.0030.01317.01
7.2.20.0070.01016.98
7.2.10.0040.01216.76
7.2.00.0100.00717.66
7.1.330.0090.00815.59
7.1.320.0080.01315.73
7.1.310.0050.01415.86
7.1.300.0020.01915.48
7.1.290.0060.01415.85
7.1.280.0060.01515.63
7.1.270.0070.01215.76
7.1.260.0060.01515.78
7.1.250.0070.01215.80
7.1.240.0040.01615.70
7.1.230.0050.01315.93
7.1.220.0060.01415.88
7.1.210.0070.01415.83
7.1.200.0050.01215.77
7.1.190.0060.01115.75
7.1.180.0050.01415.77
7.1.170.0070.01415.94
7.1.160.0060.01215.79
7.1.150.0030.01515.90
7.1.140.0050.01515.57
7.1.130.0030.01615.76
7.1.120.0020.01415.80
7.1.110.0050.01515.75
7.1.100.0080.01015.73
7.1.90.0020.01615.80
7.1.80.0050.01115.66
7.1.70.0020.01316.25
7.1.60.0010.01717.08
7.1.50.0070.01616.15
7.1.40.0050.01215.68
7.1.30.0050.01615.84
7.1.20.0080.01215.79
7.1.10.0060.01515.75
7.1.00.0040.03617.82
7.0.330.0020.01715.53
7.0.320.0050.01315.45
7.0.310.0040.01415.47
7.0.300.0060.01415.47
7.0.290.0060.01115.04
7.0.280.0040.01415.36
7.0.270.0080.01315.30
7.0.260.0050.01615.42
7.0.250.0050.01615.41
7.0.240.0040.01715.38
7.0.230.0080.01415.44
7.0.220.0080.01315.25
7.0.210.0040.01115.44
7.0.200.0030.01315.92
7.0.190.0070.01315.28
7.0.180.0100.01115.38
7.0.170.0060.01215.56
7.0.160.0060.01315.38
7.0.150.0050.01515.33
7.0.140.0060.03217.64
7.0.130.0020.01515.39
7.0.120.0070.01215.25
7.0.110.0020.01615.33
7.0.100.0030.01615.40
7.0.90.0070.01515.45
7.0.80.0030.01115.50
7.0.70.0100.00815.48
7.0.60.0060.03316.92
7.0.50.0080.02716.24
7.0.40.0070.03315.59
7.0.30.0120.02215.60
7.0.20.0140.03715.73
7.0.10.0040.03915.73
7.0.00.0060.03215.83
5.6.400.0000.03114.17
5.6.390.0050.02714.58
5.6.380.0050.02614.49
5.6.370.0100.02114.22
5.6.360.0070.02314.24
5.6.350.0050.02414.17
5.6.340.0050.02214.43
5.6.330.0080.02514.26
5.6.320.0070.02114.40
5.6.310.0050.02414.29
5.6.300.0060.02614.31
5.6.290.0050.02514.19
5.6.280.0030.04616.53
5.6.270.0030.02314.11
5.6.260.0020.02814.14
5.6.250.0050.02914.08
5.6.240.0020.03014.33
5.6.230.0060.02414.48
5.6.220.0050.02614.26
5.6.210.0030.03816.18
5.6.200.0130.04215.58
5.6.190.0040.04816.39
5.6.180.0150.03116.31
5.6.170.0160.03516.28
5.6.160.0040.04916.47
5.6.150.0070.04315.58
5.6.140.0040.03915.67
5.6.130.0090.04615.54
5.6.120.0080.04616.59
5.6.110.0030.04816.56
5.6.100.0070.03916.41
5.6.90.0060.04716.68
5.6.80.0020.03616.29
5.6.70.0030.02414.20
5.6.60.0050.02614.02
5.6.50.0050.02414.51
5.6.40.0030.02714.12
5.6.30.0070.02414.20
5.6.20.0030.02714.07
5.6.10.0050.02114.27
5.6.00.0000.03014.12
5.5.380.0030.02414.28
5.5.370.0070.02314.41
5.5.360.0070.02314.38
5.5.350.0020.04816.38
5.5.340.0040.04615.62
5.5.330.0090.04616.18
5.5.320.0120.03616.29
5.5.310.0110.03916.22
5.5.300.0080.04515.49
5.5.290.0010.05415.54
5.5.280.0040.04716.31
5.5.270.0030.03516.30
5.5.260.0020.03516.31
5.5.250.0100.03716.44
5.5.240.0040.03116.21
5.5.230.0120.02314.25
5.5.220.0050.02514.10
5.5.210.0070.02414.16
5.5.200.0030.02813.90
5.5.190.0070.02414.00
5.5.180.0020.03214.28
5.5.170.0080.02114.14
5.5.160.0100.02214.23
5.5.150.0050.02714.09
5.5.140.0050.02514.11
5.5.130.0080.02214.09
5.5.120.0030.02814.51
5.5.110.0060.02514.27
5.5.100.0080.02314.47
5.5.90.0030.02314.18
5.5.80.0050.02514.13
5.5.70.0050.02614.05
5.5.60.0030.02614.23
5.5.50.0020.03014.27
5.5.40.0020.02514.00
5.5.30.0030.02414.20
5.5.20.0040.02514.35
5.5.10.0070.02414.18
5.5.00.0030.02514.35
5.4.450.0080.03819.21
5.4.440.0110.03418.42
5.4.430.0100.03418.31
5.4.420.0110.02818.36
5.4.410.0100.02918.34
5.4.400.0080.03218.29
5.4.390.0120.03618.14
5.4.380.0120.04013.75
5.4.370.0180.04613.78
5.4.360.0090.04113.81
5.4.350.0140.03913.72
5.4.340.0120.03813.73
5.4.330.0060.01911.45
5.4.320.0040.03011.78
5.4.310.0050.03011.64
5.4.300.0020.03311.69
5.4.290.0040.03211.79
5.4.280.0030.03111.72
5.4.270.0040.03211.72
5.4.260.0040.03511.63
5.4.250.0060.03111.62
5.4.240.0080.03411.69
5.4.230.0040.04011.71
5.4.220.0080.03511.67
5.4.210.0050.03511.72
5.4.200.0070.03511.64
5.4.190.0050.03811.57
5.4.180.0070.03211.64
5.4.170.0040.03311.57
5.4.160.0040.03111.61
5.4.150.0030.03211.65
5.4.140.0050.03411.51
5.4.130.0060.03311.57
5.4.120.0050.03711.47
5.4.110.0060.02911.64
5.4.100.0030.03311.55
5.4.90.0060.03111.61
5.4.80.0040.03311.50
5.4.70.0050.03311.59
5.4.60.0090.02911.51
5.4.50.0040.03411.49
5.4.40.0050.02911.54
5.4.30.0030.03311.54
5.4.20.0040.03411.52
5.4.10.0050.03211.48
5.4.00.0050.02911.37
5.3.290.0040.01811.58
5.3.280.0060.01711.43
5.3.270.0090.02011.56
5.3.260.0070.01911.54
5.3.250.0050.02011.57
5.3.240.0050.01911.45
5.3.230.0020.01711.49
5.3.220.0050.01511.51
5.3.210.0020.02211.49
5.3.200.0060.01611.50
5.3.190.0040.01811.52
5.3.180.0050.01611.54
5.3.170.0070.01311.60
5.3.160.0040.02211.50
5.3.150.0040.01611.52
5.3.140.0040.01711.54
5.3.130.0040.01711.54
5.3.120.0050.01611.50
5.3.110.0030.01611.55
5.3.100.0040.01611.35
5.3.90.0040.01911.37
5.3.80.0040.02111.26
5.3.70.0040.01911.28
5.3.60.0050.01811.37
5.3.50.0050.01911.28
5.3.40.0040.02211.23
5.3.30.0060.01811.31
5.3.20.0040.01611.19
5.3.10.0030.01811.12
5.3.00.0080.01611.03
5.2.170.0060.0329.18
5.2.160.0030.0339.19
5.2.150.0060.0329.18
5.2.140.0060.0309.18
5.2.130.0060.0399.14
5.2.120.0060.0399.14
5.2.110.0060.0319.15
5.2.100.0040.0339.14
5.2.90.0020.0329.14
5.2.80.0070.0309.14
5.2.70.0090.0269.14
5.2.60.0050.0309.09
5.2.50.0050.0309.06
5.2.40.0060.0289.04
5.2.30.0050.0309.02
5.2.20.0040.0299.00
5.2.10.0060.0278.93
5.2.00.0050.0298.79
5.1.60.0060.0228.06
5.1.50.0070.0228.06
5.1.40.0050.0248.05
5.1.30.0030.0288.40
5.1.20.0030.0298.41
5.1.10.0050.0278.14
5.1.00.0060.0248.14
5.0.50.0050.0196.62
5.0.40.0030.0276.48
5.0.30.0030.0326.29
5.0.20.0030.0206.27
5.0.10.0030.0206.24
5.0.00.0040.0306.23
4.4.90.0040.0144.78
4.4.80.0020.0164.76
4.4.70.0020.0174.75
4.4.60.0010.0174.75
4.4.50.0000.0184.77
4.4.40.0030.0264.71
4.4.30.0030.0184.76
4.4.20.0030.0204.85
4.4.10.0020.0184.85
4.4.00.0040.0244.76
4.3.110.0030.0164.67
4.3.100.0050.0154.67
4.3.90.0050.0154.63
4.3.80.0010.0264.58
4.3.70.0010.0164.63
4.3.60.0050.0134.62
4.3.50.0040.0164.63
4.3.40.0070.0484.53
4.3.30.0020.0203.28
4.3.20.0040.0183.26
4.3.10.0050.0213.22
4.3.00.0070.01332.19

preferences:
30.37 ms | 401 KiB | 5 Q