3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); function containsString($str, $cont = array()) { $arr = ( ! is_array($cont)) ? array($cont) : $cont; // turn the string into an array foreach ($arr as $char) { if (strstr($str, $char)) { return true; } } return false; } function containsString_mlocati($str, $cont = array()) { $arr = is_array($cont) ? $cont : array($cont); foreach($arr as $item) { if(strstr($str, $item) !== false) { return true; } } return false; } $cont = array('hi there', 'ciao', 'salut', 'Number of items: 0'); echo "Usually works:\n"; $str = 'not-existing'; var_dump(containsString($str, $cont)); var_dump(containsString_mlocati($str, $cont)); $str = 'hi'; var_dump(containsString($str, $cont)); var_dump(containsString_mlocati($str, $cont)); echo "\n\n"; echo "**BUT:\n"; $str = '0'; var_dump(containsString($str, $cont)); var_dump(containsString_mlocati($str, $cont));

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.0100.01016.50
8.3.50.0030.01221.99
8.3.40.0070.00718.71
8.3.30.0060.00918.92
8.3.20.0000.00820.34
8.3.10.0080.00023.51
8.3.00.0040.00420.89
8.2.180.0080.00816.50
8.2.170.0110.00322.96
8.2.160.0130.00020.53
8.2.150.0080.00024.18
8.2.140.0050.00224.66
8.2.130.0070.00026.16
8.2.120.0040.00420.85
8.2.110.0030.00621.90
8.2.100.0050.00517.91
8.2.90.0000.00819.27
8.2.80.0000.00817.97
8.2.70.0030.00617.38
8.2.60.0080.00018.03
8.2.50.0040.00418.07
8.2.40.0030.00619.71
8.2.30.0070.00318.18
8.2.20.0090.00017.58
8.2.10.0050.00218.06
8.2.00.0000.00717.63
8.1.280.0130.00725.92
8.1.270.0040.00423.77
8.1.260.0040.00426.35
8.1.250.0000.00928.09
8.1.240.0090.00022.03
8.1.230.0040.00819.07
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00317.23
8.1.190.0030.00517.22
8.1.180.0050.00518.10
8.1.170.0040.00418.53
8.1.160.0040.00422.02
8.1.150.0040.00418.65
8.1.140.0040.00417.37
8.1.130.0000.00717.71
8.1.120.0030.00417.48
8.1.110.0040.00417.33
8.1.100.0040.00417.53
8.1.90.0040.00417.50
8.1.80.0000.00717.46
8.1.70.0000.00717.38
8.1.60.0050.00217.55
8.1.50.0000.00817.47
8.1.40.0020.00517.52
8.1.30.0000.00817.55
8.1.20.0000.00717.64
8.1.10.0040.00417.44
8.1.00.0000.00717.46
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0030.00318.36
8.0.270.0000.00717.25
8.0.260.0070.00017.17
8.0.250.0030.00317.03
8.0.240.0030.00316.94
8.0.230.0030.00316.96
8.0.220.0080.00016.91
8.0.210.0030.00316.93
8.0.200.0030.00316.82
8.0.190.0050.00316.98
8.0.180.0040.00416.81
8.0.170.0040.00416.83
8.0.160.0040.00416.82
8.0.150.0040.00416.86
8.0.140.0080.00016.85
8.0.130.0060.00013.36
8.0.120.0000.00816.76
8.0.110.0000.00716.94
8.0.100.0040.00416.77
8.0.90.0040.00416.80
8.0.80.0030.01616.90
8.0.70.0050.00216.87
8.0.60.0040.00416.93
8.0.50.0050.00216.77
8.0.30.0130.00616.96
8.0.20.0110.01117.40
8.0.10.0030.00516.86
8.0.00.0130.00616.79
7.4.330.0020.00215.00
7.4.320.0000.00616.61
7.4.300.0000.00616.61
7.4.290.0030.00316.53
7.4.280.0040.00516.61
7.4.270.0000.00816.57
7.4.260.0030.00716.62
7.4.250.0040.00416.47
7.4.240.0000.00716.60
7.4.230.0000.00716.41
7.4.220.0030.01316.53
7.4.210.0060.00816.63
7.4.200.0070.00016.52
7.4.160.0060.01016.28
7.4.150.0090.00917.40
7.4.140.0140.00517.86
7.4.130.0070.01316.61
7.4.120.0120.00616.50
7.4.110.0080.01616.47
7.4.100.0100.00716.48
7.4.90.0070.01116.39
7.4.80.0100.01319.39
7.4.70.0130.00316.42
7.4.60.0070.01116.50
7.4.50.0000.00516.39
7.4.40.0100.00616.48
7.4.30.0100.00716.55
7.4.00.0030.01414.86
7.3.330.0000.00713.27
7.3.320.0000.00613.11
7.3.310.0030.00316.29
7.3.300.0030.00316.31
7.3.290.0000.01516.30
7.3.280.0060.01116.34
7.3.270.0100.00717.40
7.3.260.0130.00316.56
7.3.250.0120.00816.50
7.3.240.0120.00616.38
7.3.230.0120.00616.69
7.3.210.0060.01016.36
7.3.200.0040.01319.39
7.3.190.0100.01116.29
7.3.180.0070.01016.44
7.3.170.0090.00916.60
7.3.160.0120.00316.45
7.3.120.0040.01114.63
7.3.10.0100.01016.25
7.3.00.0100.00816.36
7.2.330.0080.00816.64
7.2.320.0140.00916.84
7.2.310.0070.01016.93
7.2.300.0100.00716.63
7.2.290.0210.00016.42
7.2.130.0130.00916.51
7.2.120.0090.00916.29
7.2.110.0120.00516.76
7.2.100.0120.00616.69
7.2.90.0090.00916.62
7.2.80.0200.00616.77
7.2.70.0120.00616.83
7.2.60.0150.00416.93
7.2.50.0100.00716.70
7.2.40.0140.00316.95
7.2.30.0100.00616.73
7.2.20.0120.00816.85
7.2.10.0130.00616.92
7.2.00.0080.00818.21
7.1.250.0080.00815.67
7.1.200.0170.00315.74
7.1.100.0140.00418.04
7.1.70.0000.00817.13
7.1.60.0090.01619.70
7.1.50.0230.01334.66
7.1.00.0000.08022.29
7.0.200.0000.01016.63
7.0.140.0030.07321.96
7.0.70.0100.04020.01
7.0.60.0070.06019.99
7.0.50.0030.09020.37
7.0.40.0070.08020.03
7.0.30.0130.06720.05
7.0.20.0070.06320.04
7.0.10.0130.06320.08
7.0.00.0200.07020.10
5.6.280.0030.07320.99
5.6.220.0070.03720.65
5.6.210.0070.04320.50
5.6.200.0130.07721.18
5.6.190.0070.08021.11
5.6.180.0170.05021.03
5.6.170.0270.07020.96
5.6.160.0030.04320.96
5.6.150.0130.05021.07
5.6.140.0100.04021.09
5.6.130.0100.06721.14
5.6.120.0070.08021.17
5.6.110.0100.06321.14
5.6.100.0130.08021.11
5.6.90.0130.08021.02
5.6.80.0170.07720.40
5.6.70.0070.08720.41
5.6.60.0170.07020.34
5.6.50.0070.08320.50
5.6.40.0130.07020.41
5.6.30.0130.07020.50
5.6.20.0070.07320.46
5.6.10.0000.06320.41
5.6.00.0030.05020.41
5.5.360.0070.05020.35
5.5.350.0100.07020.47
5.5.340.0070.05320.84
5.5.330.0030.05720.81
5.5.320.0100.07320.94
5.5.310.0000.04720.89
5.5.300.0100.07020.91
5.5.290.0130.08020.74
5.5.280.0100.06720.84
5.5.270.0130.08320.86
5.5.260.0070.04320.88
5.5.250.0030.05720.65
5.5.240.0130.06720.22
5.5.230.0100.08720.19
5.5.220.0030.07020.22
5.5.210.0070.05020.21
5.5.200.0030.07720.11
5.5.190.0070.08320.22
5.5.180.0170.04020.16
5.5.160.0070.07720.00
5.5.150.0070.05720.18
5.5.140.0130.06020.24
5.5.130.0100.07720.13
5.5.120.0000.08720.19
5.5.110.0100.07320.17
5.5.100.0100.08020.07
5.5.90.0030.07320.17
5.5.80.0100.07319.98
5.5.70.0070.08720.06
5.5.60.0100.07020.01
5.5.50.0030.05320.00
5.5.40.0130.07320.10
5.5.30.0070.08020.06
5.5.20.0170.07320.05
5.5.10.0100.07719.97
5.5.00.0100.05720.04
5.4.450.0000.07319.46
5.4.440.0000.06719.36
5.4.430.0170.07719.21
5.4.420.0100.08019.53
5.4.410.0070.08319.32
5.4.400.0070.08019.05
5.4.390.0130.07319.09
5.4.380.0070.07719.03
5.4.370.0070.06319.15
5.4.360.0130.06718.90
5.4.350.0100.06719.05
5.4.340.0170.07019.02
5.4.320.0070.05319.09
5.4.310.0000.06319.20
5.4.300.0130.06019.00
5.4.290.0030.06318.94
5.4.280.0100.05319.00
5.4.270.0100.05319.09
5.4.260.0130.04319.04
5.4.250.0030.08018.94
5.4.240.0070.07319.10
5.4.230.0130.07319.04
5.4.220.0070.08019.16
5.4.210.0070.08319.15
5.4.200.0170.06718.90
5.4.190.0130.07019.11
5.4.180.0000.06018.85
5.4.170.0000.07319.17
5.4.160.0030.07718.86
5.4.150.0030.08718.86
5.4.140.0030.07016.39
5.4.130.0170.07016.46
5.4.120.0100.07316.51
5.4.110.0070.07716.39
5.4.100.0070.07316.39
5.4.90.0100.07016.53
5.4.80.0070.06716.43
5.4.70.0030.07016.50
5.4.60.0070.05016.31
5.4.50.0070.07016.44
5.4.40.0100.06316.49
5.4.30.0100.06716.45
5.4.20.0130.06016.36
5.4.10.0070.06316.44
5.4.00.0100.07315.87
5.3.290.0030.05714.79
5.3.280.0070.08014.57
5.3.270.0100.05714.63
5.3.260.0070.08014.58
5.3.250.0030.08014.64
5.3.240.0070.08014.61
5.3.230.0000.09014.72
5.3.220.0230.07014.52
5.3.210.0070.05714.64
5.3.200.0030.07714.68
5.3.190.0030.07714.58
5.3.180.0130.06014.56
5.3.170.0100.07314.50
5.3.160.0000.06314.66
5.3.150.0100.03714.50
5.3.140.0100.06714.51
5.3.130.0130.07314.49
5.3.120.0030.08014.59
5.3.110.0070.07714.66
5.3.100.0230.04714.10
5.3.90.0100.07014.14
5.3.80.0070.08714.03
5.3.70.0070.07714.03
5.3.60.0170.06013.93
5.3.50.0030.04314.09
5.3.40.0100.07013.96
5.3.30.0230.06313.95
5.3.20.0030.07313.81
5.3.10.0030.07713.72
5.3.00.0030.06013.75
5.2.170.0000.06312.23
5.2.160.0030.03012.23
5.2.150.0070.05712.23
5.2.140.0000.05312.23
5.2.130.0070.06312.23
5.2.120.0170.05712.23
5.2.110.0000.05712.23
5.2.100.0100.06012.23
5.2.90.0030.04312.23
5.2.80.0030.06712.23
5.2.70.0030.06312.23
5.2.60.0170.04312.23
5.2.50.0030.04012.23
5.2.40.0030.06312.23
5.2.30.0000.06712.23
5.2.20.0070.07712.23
5.2.10.0070.05312.23
5.2.00.0070.05312.23
5.1.60.0000.04312.23
5.1.50.0070.04312.23
5.1.40.0070.04712.23
5.1.30.0100.03712.23
5.1.20.0030.05312.23
5.1.10.0000.06312.23
5.1.00.0100.05012.23
5.0.50.0000.05012.23
5.0.40.0000.03712.23
5.0.30.0030.03712.23
5.0.20.0000.04012.23
5.0.10.0030.04312.23
5.0.00.0000.07012.23
4.4.90.0070.02712.23
4.4.80.0070.03712.23
4.4.70.0070.03012.23
4.4.60.0030.03712.23
4.4.50.0030.03312.23
4.4.40.0000.05312.23
4.4.30.0000.03012.23
4.4.20.0030.03712.23
4.4.10.0000.03712.23
4.4.00.0100.04712.23
4.3.110.0030.02712.23
4.3.100.0100.03012.23
4.3.90.0070.02312.23
4.3.80.0000.04012.23
4.3.70.0030.02312.23
4.3.60.0000.02012.23
4.3.50.0070.02712.23
4.3.40.0000.05312.23
4.3.30.0000.03712.23
4.3.20.0000.04012.23
4.3.10.0030.03712.23
4.3.00.0000.03312.23

preferences:
48.11 ms | 401 KiB | 5 Q