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; } } } echo sub_string("ello", "hello");

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.0120.00816.63
8.3.50.0040.01218.04
8.3.40.0100.00618.68
8.3.30.0070.00718.76
8.3.20.0000.00719.21
8.3.10.0000.00821.90
8.3.00.0040.00420.58
8.2.180.0130.00918.16
8.2.170.0150.00022.96
8.2.160.0130.00022.30
8.2.150.0030.00525.66
8.2.140.0030.00524.66
8.2.130.0040.00419.83
8.2.120.0040.00426.35
8.2.110.0060.00320.27
8.2.100.0040.00717.78
8.2.90.0040.00417.63
8.2.80.0000.00817.97
8.2.70.0040.00418.16
8.2.60.0000.00718.16
8.2.50.0060.00318.10
8.2.40.0050.00219.46
8.2.30.0030.00619.38
8.2.20.0070.00018.13
8.2.10.0050.00218.20
8.2.00.0090.00017.71
8.1.280.0140.00325.92
8.1.270.0080.00020.68
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0080.00023.86
8.1.230.0110.00020.83
8.1.220.0080.00017.76
8.1.210.0090.00018.77
8.1.200.0060.00617.22
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0080.00018.50
8.1.160.0040.00418.77
8.1.150.0000.00818.91
8.1.140.0070.00022.23
8.1.130.0030.00322.11
8.1.120.0000.00717.36
8.1.110.0000.00817.32
8.1.100.0080.00017.35
8.1.90.0030.00517.39
8.1.80.0040.00417.52
8.1.70.0050.00217.50
8.1.60.0060.00317.64
8.1.50.0030.00617.43
8.1.40.0000.01017.42
8.1.30.0030.00517.66
8.1.20.0050.00217.72
8.1.10.0040.00417.60
8.1.00.0030.00617.54
8.0.300.0040.00818.77
8.0.290.0040.00416.63
8.0.280.0070.00018.36
8.0.270.0030.00317.23
8.0.260.0030.00318.46
8.0.250.0030.00317.03
8.0.240.0000.00816.99
8.0.230.0050.00316.95
8.0.220.0000.01016.92
8.0.210.0050.00316.74
8.0.200.0070.00016.86
8.0.190.0040.00416.89
8.0.180.0040.00416.90
8.0.170.0060.00316.89
8.0.160.0050.00216.94
8.0.150.0000.00716.85
8.0.140.0030.00416.87
8.0.130.0050.00013.26
8.0.120.0040.00416.88
8.0.110.0090.00016.86
8.0.100.0000.00716.72
8.0.90.0040.00416.77
8.0.80.0110.00616.90
8.0.70.0000.00816.79
8.0.60.0040.00416.73
8.0.50.0000.00716.70
8.0.30.0100.01017.07
8.0.20.0090.00917.40
8.0.10.0070.00016.91
8.0.00.0080.01116.73
7.4.330.0020.00215.55
7.4.320.0000.00716.65
7.4.300.0000.00616.50
7.4.290.0040.00416.61
7.4.280.0030.00516.48
7.4.270.0030.00316.52
7.4.260.0070.00016.53
7.4.250.0080.00016.57
7.4.240.0040.00416.50
7.4.230.0030.00316.61
7.4.220.0080.00016.50
7.4.210.0120.00416.63
7.4.200.0030.00316.63
7.4.160.0100.00716.51
7.4.140.0130.01317.86
7.4.130.0110.00616.56
7.4.120.0100.00916.54
7.4.110.0100.00616.54
7.4.100.0140.00416.54
7.4.90.0100.00716.53
7.4.80.0100.00719.39
7.4.70.0060.01616.58
7.4.60.0090.00616.46
7.4.50.0060.00916.45
7.4.40.0110.00516.68
7.4.00.0070.01014.76
7.3.330.0020.00213.13
7.3.320.0060.00013.19
7.3.310.0000.00816.25
7.3.300.0060.00016.36
7.3.290.0040.00416.30
7.3.280.0110.00316.36
7.3.260.0100.01016.60
7.3.240.0080.01316.63
7.3.230.0140.00316.55
7.3.210.0060.01016.63
7.3.200.0060.01616.27
7.3.190.0080.00816.53
7.3.180.0060.01516.32
7.3.170.0150.00916.49
7.3.160.0090.00616.54
7.2.330.0080.00816.76
7.2.320.0090.00616.86
7.2.310.0030.01316.80
7.2.300.0090.00616.80
7.2.290.0000.01716.72
7.2.110.0710.01114.63
7.2.100.0120.00814.49
7.2.90.0080.01114.58
7.2.80.0110.00614.71
7.2.70.0550.01214.99
7.2.60.1560.00614.97
7.2.50.0520.01115.01
7.2.40.0450.01315.00
7.2.30.0440.00514.83
7.2.20.0790.00715.03
7.2.10.1760.00815.07
7.2.00.1090.00514.79
7.1.230.1120.00313.73
7.1.220.1040.00613.86
7.1.210.0180.00914.03
7.1.200.0090.00513.79
7.1.190.0460.00613.84
7.1.180.0620.00813.90
7.1.170.0440.00713.92
7.1.160.0720.00713.85
7.1.150.0390.00813.74
7.1.140.1660.00514.00
7.1.130.1260.01113.83
7.1.120.1240.00813.65
7.1.110.1060.00713.82
7.1.100.0900.01013.64
7.1.90.0470.00213.76
7.1.80.0730.00613.78
7.1.70.1010.00513.65
7.1.60.1070.00931.82
7.1.50.1210.01431.63
7.1.40.1280.01031.77
7.1.30.1300.00831.70
7.1.20.1330.01332.01
7.1.10.1530.00213.68
7.1.00.1290.00813.77
5.6.380.0110.00614.02

preferences:
40.49 ms | 400 KiB | 5 Q