3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Starting in_array\n"; $limit = 400000; $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.4.10.0030.05514.95
7.4.00.0130.04614.84
7.3.130.0160.04514.80
7.3.120.0070.04014.96
7.3.110.0100.04914.91
7.3.100.0150.02815.03
7.3.90.0070.03614.95
7.3.80.0070.05314.73
7.3.70.0030.04014.76
7.3.60.0070.03314.86
7.3.50.0100.03414.91
7.3.40.0030.03714.84
7.3.30.0060.02914.83
7.3.20.0060.03216.80
7.3.10.0070.03416.73
7.3.00.0000.04616.69
7.2.260.0070.05414.80
7.2.250.0030.05515.31
7.2.240.0060.03215.14
7.2.230.0130.03215.00
7.2.220.0030.04715.00
7.2.210.0040.03915.00
7.2.200.0030.04115.20
7.2.190.0000.04514.98
7.2.180.0040.03915.02
7.2.170.0030.03814.92
7.2.160.0100.03515.19
7.2.150.0030.04216.98
7.2.140.0030.04017.10
7.2.130.0060.03616.93
7.2.120.0070.03816.92
7.2.110.0100.03217.02
7.2.100.0030.04017.02
7.2.90.0030.04217.14
7.2.80.0070.03416.89
7.2.70.0070.04116.81
7.2.60.0030.05216.67
7.2.50.0070.04117.01
7.2.40.0000.04116.86
7.2.30.0100.03717.02
7.2.20.0030.04116.99
7.2.10.0000.04517.07
7.2.00.0050.03918.14
7.1.330.0030.06615.85
7.1.320.0000.07115.80
7.1.310.0000.06315.88
7.1.300.0070.06615.99
7.1.290.0060.06115.87
7.1.280.0030.07015.73
7.1.270.0030.06615.63
7.1.260.0000.06915.86
7.1.250.0100.08315.98
7.1.240.0130.06115.68
7.1.230.0030.06415.99
7.1.220.0060.06215.68
7.1.210.0060.06115.84
7.1.200.0100.05815.61
7.1.190.0030.06515.88
7.1.180.0000.06815.57
7.1.170.0030.06315.71
7.1.160.0100.06015.80
7.1.150.0100.06215.80
7.1.140.0070.07315.68
7.1.130.0030.06415.94
7.1.120.0000.06915.45
7.1.110.0030.06515.79
7.1.100.0030.07315.92
7.1.90.0030.06415.66
7.1.80.0030.06416.07
7.1.70.0020.04716.62
7.1.60.0030.05417.82
7.1.50.0070.06016.27
7.1.40.0070.06615.75
7.1.30.0030.06415.75
7.1.20.0030.06615.99
7.1.10.0030.06215.74
7.1.00.0050.09019.02
7.0.330.0070.07115.52
7.0.320.0030.07215.43
7.0.310.0000.06515.37
7.0.300.0000.07115.37
7.0.290.0030.06815.43
7.0.280.0060.06215.51
7.0.270.0030.06915.46
7.0.260.0030.06715.58
7.0.250.0030.06215.56
7.0.240.0030.08115.31
7.0.230.0030.06715.36
7.0.220.0030.06815.26
7.0.210.0130.05915.32
7.0.200.0030.05216.07
7.0.190.0000.06315.32
7.0.180.0030.06315.62
7.0.170.0070.06015.55
7.0.160.0070.06415.43
7.0.150.0060.06815.45
7.0.140.0030.08818.82
7.0.130.0060.06815.13
7.0.120.0070.07815.45
7.0.110.0000.07815.50
7.0.100.0120.07117.81
7.0.90.0120.07917.75
7.0.80.0170.08217.67
7.0.70.0120.07917.55
7.0.60.0070.05917.50
7.0.50.0150.08517.86
7.0.40.0080.09116.81
7.0.30.0070.09216.74
7.0.20.0070.09016.69
7.0.10.0070.08516.72
7.0.00.0070.06716.80
5.6.400.0070.17014.39
5.6.390.0070.20214.54
5.6.380.0000.19114.11
5.6.370.0070.17514.57
5.6.360.0030.17514.57
5.6.350.0070.16914.58
5.6.340.0030.16714.31
5.6.330.0070.18014.49
5.6.320.0030.20114.44
5.6.310.0030.17414.36
5.6.300.0100.18514.53
5.6.290.0070.17214.60
5.6.280.0020.19617.72
5.6.270.0070.21214.09
5.6.260.0070.16914.64
5.6.250.0050.18217.62
5.6.240.0070.18117.58
5.6.230.0030.17417.41
5.6.220.0050.16917.47
5.6.210.0080.14117.44
5.6.200.0050.18817.73
5.6.190.0050.17417.84
5.6.180.0070.17517.49
5.6.170.0020.15617.80
5.6.160.0050.16617.71
5.6.150.0030.17317.58
5.6.140.0080.16717.59
5.6.130.0030.17517.80
5.6.120.0030.16717.70
5.6.110.0030.16817.60
5.6.100.0080.17617.56
5.6.90.0070.16917.67
5.6.80.0120.16917.26
5.6.70.0050.18817.16
5.6.60.0030.16717.44
5.6.50.0120.16717.24
5.6.40.0120.17117.25
5.6.30.0050.17317.29
5.6.20.0070.16917.45
5.6.10.0050.19717.13
5.6.00.0070.17817.42
5.5.380.0100.17317.26
5.5.370.0080.17417.28
5.5.360.0070.16817.18
5.5.350.0130.17017.29
5.5.340.0070.16117.35
5.5.330.0070.15817.51
5.5.320.0020.16917.64
5.5.310.0030.18417.67
5.5.300.0020.16617.52
5.5.290.0050.18817.55
5.5.280.0080.17117.50
5.5.270.0020.17517.35
5.5.260.0100.17617.31
5.5.250.0130.17017.41
5.5.240.0070.17816.99
5.5.230.0080.13717.22
5.5.220.0070.15717.29
5.5.210.0080.18217.17
5.5.200.0070.16917.03
5.5.190.0100.15017.18
5.5.180.0050.14817.09
5.5.170.0100.22014.14
5.5.160.0030.14117.20
5.5.150.0020.15417.01
5.5.140.0020.14117.01
5.5.130.0080.13617.16
5.5.120.0030.13817.00
5.5.110.0070.13616.99
5.5.100.0020.13717.06
5.5.90.0120.16116.91
5.5.80.0030.15617.10
5.5.70.0020.15316.93
5.5.60.0020.13817.16
5.5.50.0070.13716.96
5.5.40.0020.17417.15
5.5.30.0070.16117.06
5.5.20.0050.15817.07
5.5.10.0080.14417.16
5.5.00.0100.12917.05
5.4.450.0030.17515.13
5.4.440.0050.16714.93
5.4.430.0020.17815.27
5.4.420.0040.18515.20
5.4.410.0070.17815.11
5.4.400.0030.17615.09
5.4.390.0070.16715.03
5.4.380.0080.15015.09
5.4.370.0080.16914.92
5.4.360.0020.17714.91
5.4.350.0070.16815.06
5.4.340.0070.16315.08
5.4.330.0000.17610.99
5.4.320.0000.15515.00
5.4.310.0070.16314.72
5.4.300.0050.16114.70
5.4.290.0000.15315.05
5.4.280.0070.15614.97
5.4.270.0070.13114.99
5.4.260.0050.15214.95
5.4.250.0020.16414.80
5.4.240.0030.13815.03
5.4.230.0000.14014.77
5.4.220.0030.17514.89
5.4.210.0030.13615.01
5.4.200.0030.14015.01
5.4.190.0030.13914.96
5.4.180.0070.13214.88
5.4.170.0070.15414.82
5.4.160.0050.15714.94
5.4.150.0080.13715.05
5.4.140.0050.15013.53
5.4.130.0050.16413.53
5.4.120.0030.18413.56
5.4.110.0080.18113.59
5.4.100.0100.15513.54
5.4.90.0070.14613.42
5.4.80.0050.15913.70
5.4.70.0020.14213.47
5.4.60.0080.16113.61
5.4.50.0100.16413.53
5.4.40.0000.17013.61
5.4.30.0030.16513.66
5.4.20.0030.15513.50
5.4.10.0000.17513.63
5.4.00.0070.16813.25
5.3.290.0050.01812.47
5.3.280.0020.02212.28
5.3.270.0030.02712.38
5.3.260.0010.02412.33
5.3.250.0000.02412.24
5.3.240.0000.02412.19
5.3.230.0030.04012.32
5.3.220.0030.04012.30
5.3.210.0080.03812.27
5.3.200.0050.04212.36
5.3.190.0020.04512.37
5.3.180.0090.01712.37
5.3.170.0030.04112.42
5.3.160.0020.02812.41
5.3.150.0030.04112.34
5.3.140.0000.03312.34
5.3.130.0070.04012.41
5.3.120.0040.03712.28
5.3.110.0000.04312.37
5.3.100.0040.04012.15
5.3.90.0050.03312.07
5.3.80.0050.03512.00
5.3.70.0080.03111.97
5.3.60.0030.04112.00
5.3.50.0030.03012.04
5.3.40.0030.03011.92
5.3.30.0050.04211.96
5.3.20.0020.03711.88
5.3.10.0020.04011.71
5.3.00.0070.03511.71
5.2.170.0030.05710.94
5.2.160.0030.06011.12
5.2.150.0100.06011.19
5.2.140.0100.05710.93
5.2.130.0030.06311.08
5.2.120.0070.05310.94
5.2.110.0070.06011.17
5.2.100.0070.05711.15
5.2.90.0070.04311.10
5.2.80.0070.06011.06
5.2.70.0030.05010.89
5.2.60.0030.06011.04
5.2.50.0030.06710.93
5.2.40.0030.06711.03
5.2.30.0100.05711.03
5.2.20.0030.06010.97
5.2.10.0070.05710.92
5.2.00.0100.05710.77
5.1.60.0070.04310.00
5.1.50.0100.04710.00
5.1.40.0100.05010.01
5.1.30.0000.04710.40
5.1.20.0030.05010.41
5.1.10.0100.04710.02
5.1.00.0070.05310.10
5.0.50.0100.0378.56
5.0.40.0000.0438.36
5.0.30.0030.0608.36
5.0.20.0070.0408.36
5.0.10.0030.0438.36
5.0.00.0070.0608.36
4.4.90.0000.0278.36
4.4.80.0070.0278.36
4.4.70.0100.0238.36
4.4.60.0000.0378.36
4.4.50.0030.0278.36
4.4.40.0030.0508.36
4.4.30.0030.0308.36
4.4.20.0070.0238.36
4.4.10.0000.0378.36
4.4.00.0030.0508.36
4.3.110.0030.0378.36
4.3.100.0000.0378.36
4.3.90.0000.0378.36
4.3.80.0000.0538.36
4.3.70.0000.0378.36
4.3.60.0000.0408.36
4.3.50.0030.0338.36
4.3.40.0070.0478.36
4.3.30.0030.0138.36
4.3.20.0000.0378.36
4.3.10.0000.0378.36
4.3.00.0000.0208.36

preferences:
52.02 ms | 401 KiB | 5 Q