3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sub_string($pattern, $subject) { $n = strlen($subject); $m = strlen($pattern); for ($i = 0; $i < $n-$m; $i++) { $j = 0; while ($j < $m && $subject[$i+$j] == $pattern[$j]) { $j++; } if ($j == $m){ return 1; }else{ return 0; } } return -1; } echo sub_string("!!!!", "damn you");

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.40.0120.00318.67
8.3.30.0060.00918.66
8.3.20.0040.00419.32
8.3.10.0080.00023.52
8.3.00.0080.00020.58
8.2.170.0170.00022.96
8.2.160.0040.01122.03
8.2.150.0000.00824.18
8.2.140.0050.00524.66
8.2.130.0070.00026.16
8.2.120.0080.00019.89
8.2.110.0060.00319.27
8.2.100.0090.00317.78
8.2.90.0030.00517.75
8.2.80.0030.00617.97
8.2.70.0060.00317.78
8.2.60.0000.00718.34
8.2.50.0000.00818.10
8.2.40.0000.00719.46
8.2.30.0040.00419.30
8.2.20.0070.00018.06
8.2.10.0040.00418.13
8.2.00.0030.00617.59
8.1.270.0030.00618.82
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0060.00322.02
8.1.230.0110.00018.97
8.1.220.0030.00517.75
8.1.210.0040.00418.77
8.1.200.0000.01317.22
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0050.00318.57
8.1.160.0000.00718.89
8.1.150.0040.00418.89
8.1.140.0000.00722.13
8.1.130.0070.00020.31
8.1.120.0030.00317.48
8.1.110.0040.00417.35
8.1.100.0090.00017.40
8.1.90.0040.00417.46
8.1.80.0000.00717.43
8.1.70.0050.00317.47
8.1.60.0040.00417.59
8.1.50.0000.00717.41
8.1.40.0000.00817.51
8.1.30.0040.00417.48
8.1.20.0000.00717.68
8.1.10.0000.00717.59
8.1.00.0050.00317.39
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0030.00318.45
8.0.270.0040.00417.17
8.0.260.0070.00018.45
8.0.250.0000.00716.96
8.0.240.0070.00016.96
8.0.230.0030.00316.89
8.0.220.0080.00316.95
8.0.210.0060.00016.80
8.0.200.0080.00016.83
8.0.190.0000.00716.95
8.0.180.0040.00416.93
8.0.170.0040.00416.82
8.0.160.0070.00016.95
8.0.150.0000.01016.86
8.0.140.0000.00716.87
8.0.130.0050.00013.34
8.0.120.0070.00016.91
8.0.110.0040.00416.84
8.0.100.0000.00716.83
8.0.90.0000.00716.76
8.0.80.0100.00516.88
8.0.70.0030.00316.82
8.0.60.0040.00416.71
8.0.50.0000.00816.79
8.0.30.0040.01317.12
8.0.20.0090.01017.40
8.0.10.0050.00217.04
8.0.00.0130.00516.81
7.4.330.0030.00315.55
7.4.320.0040.00416.61
7.4.300.0000.00616.49
7.4.290.0070.00016.55
7.4.280.0030.00616.52
7.4.270.0000.00816.53
7.4.260.0040.00416.63
7.4.250.0000.00816.45
7.4.240.0030.00316.61
7.4.230.0040.00416.35
7.4.220.0040.00416.49
7.4.210.0140.00616.47
7.4.200.0000.00716.61
7.4.160.0090.01116.49
7.4.140.0110.01817.86
7.4.130.0090.00916.37
7.4.120.0100.00816.48
7.4.110.0140.00316.57
7.4.100.0060.01316.59
7.4.90.0100.01016.52
7.4.80.0120.01219.39
7.4.70.0160.00716.44
7.4.60.0090.00616.30
7.4.50.0000.01116.52
7.4.40.0080.00816.50
7.4.00.0120.00314.86
7.3.330.0050.00013.34
7.3.320.0000.00513.36
7.3.310.0030.00516.17
7.3.300.0030.00316.32
7.3.290.0040.00416.32
7.3.280.0000.01816.38
7.3.260.0070.01116.40
7.3.240.0100.01016.41
7.3.230.0060.01316.50
7.3.210.0120.00316.22
7.3.200.0090.00616.59
7.3.190.0030.01316.62
7.3.180.0100.00716.35
7.3.170.0100.01416.33
7.3.160.0110.00316.55
7.2.330.0070.01116.42
7.2.320.0090.01116.86
7.2.310.0040.01216.79
7.2.300.0040.01716.63
7.2.290.0100.01316.43
7.2.110.1320.00314.45
7.2.100.0320.00914.43
7.2.90.1130.00314.66
7.2.80.0820.01114.27
7.2.70.1240.01014.82
7.2.60.1430.01314.71
7.2.50.1190.00715.24
7.2.40.1150.01014.85
7.2.30.0470.01314.89
7.2.20.0600.01514.91
7.2.10.0510.00714.81
7.2.00.0840.01314.80
7.1.230.1160.01014.11
7.1.220.1160.00313.67
7.1.210.0440.00913.66
7.1.200.0860.00313.96
7.1.190.0710.00713.96
7.1.180.1490.00013.80
7.1.170.0810.01313.93
7.1.160.0690.00313.68
7.1.150.0690.01013.78
7.1.140.0420.01513.70
7.1.130.0470.00313.55
7.1.120.0780.00713.88
7.1.110.0780.00713.89
7.1.100.0860.00313.98
7.1.90.0380.01013.78
7.1.80.0690.01014.03
7.1.70.0650.00913.82
7.1.60.0770.01631.18
7.1.50.1150.01031.43
7.1.40.1230.00331.75
7.1.30.1250.01031.60
7.1.20.1070.02031.85
7.1.10.1400.01013.54
7.1.00.0810.00013.88
5.6.380.0140.00814.23

preferences:
56.2 ms | 400 KiB | 5 Q