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("hel", "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.0140.00916.50
8.3.50.0110.00418.32
8.3.40.0120.00318.67
8.3.30.0070.00718.75
8.3.20.0040.00419.34
8.3.10.0050.00321.88
8.3.00.0060.00320.69
8.2.180.0120.00918.42
8.2.170.0040.01122.96
8.2.160.0130.00022.16
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0080.00018.16
8.2.120.0030.00526.35
8.2.110.0070.00321.04
8.2.100.0080.00417.91
8.2.90.0030.00517.75
8.2.80.0050.00317.97
8.2.70.0000.00817.79
8.2.60.0040.00418.16
8.2.50.0040.00418.10
8.2.40.0040.00419.30
8.2.30.0040.00419.23
8.2.20.0000.00718.02
8.2.10.0040.00418.12
8.2.00.0080.00017.64
8.1.280.0100.00325.92
8.1.270.0080.00020.78
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0030.00623.98
8.1.230.0110.00020.19
8.1.220.0000.00717.74
8.1.210.0050.00318.77
8.1.200.0090.00317.23
8.1.190.0040.00417.23
8.1.180.0020.00518.10
8.1.170.0000.00818.51
8.1.160.0000.00718.81
8.1.150.0040.00418.95
8.1.140.0040.00422.15
8.1.130.0000.00721.92
8.1.120.0000.00717.50
8.1.110.0040.00417.46
8.1.100.0040.00417.43
8.1.90.0070.00017.42
8.1.80.0000.00717.37
8.1.70.0030.00317.43
8.1.60.0030.00517.58
8.1.50.0000.00817.54
8.1.40.0090.00317.56
8.1.30.0000.00817.73
8.1.20.0000.00717.65
8.1.10.0040.00417.60
8.1.00.0040.00417.53
8.0.300.0040.00419.71
8.0.290.0050.00216.75
8.0.280.0040.00418.38
8.0.270.0040.00417.18
8.0.260.0060.00018.50
8.0.250.0070.00017.01
8.0.240.0030.00316.92
8.0.230.0000.00716.95
8.0.220.0030.00516.89
8.0.210.0030.00316.91
8.0.200.0000.00716.98
8.0.190.0040.00416.84
8.0.180.0040.00416.88
8.0.170.0030.00516.95
8.0.160.0030.00316.84
8.0.150.0000.00816.79
8.0.140.0030.00316.74
8.0.130.0000.00513.28
8.0.120.0050.00216.85
8.0.110.0040.00416.77
8.0.100.0000.00716.84
8.0.90.0070.00016.77
8.0.80.0130.00516.84
8.0.70.0040.00416.70
8.0.60.0000.00716.78
8.0.50.0050.00216.86
8.0.30.0160.01017.30
8.0.20.0130.00717.40
8.0.10.0080.00017.02
8.0.00.0080.01116.74
7.4.330.0000.00415.55
7.4.320.0030.00316.50
7.4.300.0060.00016.50
7.4.290.0030.00316.41
7.4.280.0030.00516.39
7.4.270.0000.00716.49
7.4.260.0030.00316.58
7.4.250.0060.00316.61
7.4.240.0040.00416.61
7.4.230.0000.00716.25
7.4.220.0040.00416.62
7.4.210.0060.00816.59
7.4.200.0040.00416.50
7.4.160.0100.01016.56
7.4.140.0180.01017.86
7.4.130.0070.01016.54
7.4.120.0110.00616.56
7.4.110.0130.00416.71
7.4.100.0130.00316.61
7.4.90.0160.00616.43
7.4.80.0160.01019.39
7.4.70.0060.01216.52
7.4.60.0030.01316.36
7.4.50.0080.00616.55
7.4.40.0130.00316.63
7.4.00.0090.00614.89
7.3.330.0000.00513.33
7.3.320.0030.00313.18
7.3.310.0060.00316.39
7.3.300.0030.00316.40
7.3.290.0040.00416.36
7.3.280.0130.00316.32
7.3.260.0120.00916.38
7.3.240.0100.00916.45
7.3.230.0060.01616.59
7.3.210.0130.00316.50
7.3.200.0000.01616.41
7.3.190.0070.01516.52
7.3.180.0070.01016.32
7.3.170.0090.00916.47
7.3.160.0130.00316.37
7.2.330.0140.00416.57
7.2.320.0100.00716.36
7.2.310.0080.00816.80
7.2.300.0060.01016.45
7.2.290.0040.01316.79
7.2.110.1780.01214.36
7.2.100.0100.01014.54
7.2.90.0060.01114.51
7.2.80.1630.01014.52
7.2.70.0120.00615.06
7.2.60.0070.01714.79
7.2.50.0430.01014.66
7.2.40.0040.01514.64
7.2.30.0110.00815.02
7.2.20.0000.01915.04
7.2.10.0090.01614.97
7.2.00.0170.01314.86
7.1.230.0110.00513.59
7.1.220.0030.01513.63
7.1.210.1110.00714.02
7.1.200.1640.01013.87
7.1.190.0800.00713.48
7.1.180.0150.00513.94
7.1.170.0090.00913.82
7.1.160.0390.00613.93
7.1.150.0090.00613.94
7.1.140.1420.00313.98
7.1.130.0150.00913.72
7.1.120.0630.01113.64
7.1.110.0090.00913.63
7.1.100.1240.00013.70
7.1.90.1370.01013.48
7.1.80.0190.00313.55
7.1.70.0170.00613.80
7.1.60.0990.01031.93
7.1.50.0730.00631.84
7.1.40.1270.01831.73
7.1.30.0310.00631.55
7.1.20.1570.00931.68
7.1.10.0450.01013.46
7.1.00.0180.00413.73
5.6.380.0040.01113.92

preferences:
67.77 ms | 401 KiB | 5 Q