3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sep = "long string"; $text = "blablablablablablablabla-long strin"; $sepLen = strlen($sep); $textLen = strlen($text); $end = $textLen; for ($pos = 0; $pos < $textLen; $pos++) { if (false === $pos = strpos($text, $sep[0], $pos)) { break; } if (substr_compare($text, $sep, $pos, min($sepLen, $textLen - $pos)) === 0) { $end = $pos; break; } } echo $end;

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.5.30.0090.00817.66
8.5.20.0100.00720.27
8.5.10.0100.00719.96
8.5.00.0120.00920.09
8.4.180.0130.01019.77
8.4.170.0100.01020.69
8.4.160.0140.00723.14
8.4.150.0060.00616.92
8.4.140.0140.00717.82
8.4.130.0070.00619.66
8.4.120.0090.01120.30
8.4.110.0120.00722.45
8.4.100.0130.00620.52
8.4.90.0050.00419.00
8.4.80.0120.01020.71
8.4.70.0060.00217.75
8.4.60.0150.00618.52
8.4.50.0120.00818.73
8.4.40.0090.01019.33
8.4.30.0140.00717.93
8.4.20.0130.00717.78
8.4.10.0040.01117.81
8.3.300.0140.00620.68
8.3.290.0120.00920.59
8.3.280.0140.00618.25
8.3.270.0100.01116.53
8.3.260.0130.00616.50
8.3.250.0040.00518.93
8.3.240.0050.00320.86
8.3.230.0140.00516.48
8.3.220.0050.00418.71
8.3.210.0090.00516.57
8.3.200.0060.00516.73
8.3.190.0110.00817.20
8.3.180.0080.01116.41
8.3.170.0190.00020.75
8.3.160.0040.01417.36
8.3.150.0030.01620.64
8.3.140.0040.00418.33
8.3.130.0050.00516.60
8.3.120.0040.00418.91
8.3.110.0070.01120.94
8.3.100.0070.00424.06
8.3.90.0040.00426.77
8.3.80.0030.00617.97
8.3.70.0130.01016.75
8.3.60.0140.00318.18
8.3.50.0070.01322.11
8.3.40.0070.00718.81
8.3.30.0040.01118.63
8.3.20.0000.00820.16
8.3.10.0080.00020.48
8.3.00.0040.00420.70
8.2.300.0110.00818.00
8.2.290.0040.00420.80
8.2.280.0140.00420.19
8.2.270.0180.00017.15
8.2.260.0070.00719.07
8.2.250.0040.00416.63
8.2.240.0060.00316.94
8.2.230.0090.00022.58
8.2.220.0070.00737.54
8.2.210.0080.00026.77
8.2.200.0080.00016.63
8.2.190.0040.01116.58
8.2.180.0110.00316.88
8.2.170.0100.01022.96
8.2.160.0070.00719.19
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0030.00619.48
8.2.120.0030.00526.35
8.2.110.0040.00419.38
8.2.100.0080.00817.72
8.2.90.0000.00819.30
8.2.80.0000.00817.97
8.2.70.0000.00817.63
8.2.60.0030.00617.92
8.2.50.0070.00418.10
8.2.40.0040.00420.77
8.2.30.0040.00419.38
8.2.20.0000.00717.69
8.2.10.0070.00018.03
8.2.00.0000.00718.11
8.1.340.0130.00717.77
8.1.330.0130.00423.54
8.1.320.0130.00716.02
8.1.310.0090.00016.54
8.1.300.0060.01016.37
8.1.290.0030.00630.84
8.1.280.0110.00425.92
8.1.270.0040.00423.83
8.1.260.0080.00028.09
8.1.250.0000.00728.09
8.1.240.0090.00022.14
8.1.230.0080.00317.64
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0060.00317.23
8.1.190.0000.00817.11
8.1.180.0000.00818.10
8.1.170.0040.00418.39
8.1.160.0000.00821.00
8.1.150.0040.00418.74
8.1.140.0000.00819.43
8.1.130.0030.00317.69
8.1.120.0040.00417.24
8.1.110.0040.00417.41
8.1.100.0050.00217.31
8.1.90.0040.00417.42
8.1.80.0000.00717.30
8.1.70.0000.00717.40
8.1.60.0000.00717.58
8.1.50.0000.00817.46
8.1.40.0050.00317.50
8.1.30.0030.00517.57
8.1.20.0040.00417.50
8.1.10.0040.00417.62
8.1.00.0030.00617.56
8.0.300.0060.00319.64
8.0.290.0030.00616.75
8.0.280.0000.00818.45
8.0.270.0000.00717.30
8.0.260.0030.00317.34
8.0.250.0030.00316.97
8.0.240.0000.00616.97
8.0.230.0070.00016.86
8.0.220.0030.00316.88
8.0.210.0000.00716.76
8.0.200.0030.00316.81
8.0.190.0000.00716.88
8.0.180.0050.00316.88
8.0.170.0000.00816.87
8.0.160.0040.00416.86
8.0.150.0000.00716.77
8.0.140.0040.00416.77
8.0.130.0050.00213.22
8.0.120.0050.00316.70
8.0.110.0040.00416.89
8.0.100.0040.00416.66
8.0.90.0020.00516.72
8.0.80.0120.00916.90
8.0.70.0040.00416.89
8.0.60.0040.00416.88
8.0.50.0000.00816.78
8.0.30.0070.00917.04
8.0.20.0090.00917.40
8.0.10.0000.00717.00
8.0.00.0100.00916.69
7.4.330.0050.00015.08
7.4.320.0000.00716.41
7.4.300.0000.00716.50
7.4.290.0070.00016.64
7.4.280.0030.00516.55
7.4.270.0030.00316.52
7.4.260.0000.00716.58
7.4.250.0040.00416.48
7.4.240.0000.00716.50
7.4.230.0000.00716.60
7.4.220.0120.00616.43
7.4.210.0110.00316.70
7.4.200.0050.00316.44
7.4.160.0000.01516.36
7.4.150.0100.00617.40
7.4.140.0060.01617.86
7.4.130.0110.00616.43
7.4.120.0110.00916.50
7.4.110.0060.01216.43
7.4.100.0070.01516.66
7.4.90.0090.00916.52
7.4.80.0040.01219.39
7.4.70.0060.00916.39
7.4.60.0060.00916.70
7.4.50.0030.01316.56
7.4.40.0100.00716.59
7.4.30.0060.00916.55
7.4.00.0050.00315.08
7.3.330.0040.00413.17
7.3.320.0050.00013.26
7.3.310.0000.00716.32
7.3.300.0000.00716.25
7.3.290.0030.01316.35
7.3.280.0080.01216.35
7.3.270.0110.00617.40
7.3.260.0180.00016.35
7.3.250.0120.00616.29
7.3.240.0070.01016.45
7.3.230.0130.01016.55
7.3.210.0110.00716.35
7.3.200.0180.00316.34
7.3.190.0120.00916.44
7.3.180.0070.01016.50
7.3.170.0030.01416.29
7.3.160.0080.00816.53
7.3.120.0060.00614.80
7.3.110.0100.00314.73
7.3.100.0030.01014.89
7.3.90.0060.00614.63
7.3.80.0070.00714.87
7.3.70.0000.01414.61
7.3.60.0030.01015.02
7.3.50.0070.00414.94
7.3.40.0030.00614.63
7.3.30.0100.00314.81
7.3.20.0060.00316.59
7.3.10.0070.00716.76
7.3.00.0000.01116.78
7.2.330.0200.00316.81
7.2.320.0160.02016.42
7.2.310.0100.00816.71
7.2.300.0100.00716.62
7.2.290.0100.00716.73
7.2.240.0100.00315.16
7.2.230.0100.00315.34
7.2.220.0030.01014.71
7.2.210.0000.01415.02
7.2.200.0060.00914.64
7.2.190.0090.00615.18
7.2.180.0060.00914.88
7.2.170.0060.00315.27
7.2.160.0060.00615.17
7.2.150.0070.00716.91
7.2.140.0100.00016.97
7.2.130.0030.00816.77
7.2.120.0080.00317.03
7.2.110.0060.00917.04
7.2.100.0030.00716.59
7.2.90.0060.00616.85
7.2.80.0060.00617.06
7.2.70.0100.00317.01
7.2.60.0080.00516.69
7.2.50.0000.01416.90
7.2.40.0030.01017.09
7.2.30.0160.00017.08
7.2.20.0110.00416.64
7.2.10.0050.00516.88
7.2.00.0060.00616.91
7.1.330.0070.00715.70
7.1.320.0040.00715.48
7.1.310.0040.01115.67
7.1.300.0030.01215.79
7.1.290.0090.00616.02
7.1.280.0070.00715.91
7.1.270.0090.00415.99
7.1.260.0070.00715.75
7.1.250.0060.00315.89
7.1.200.0060.00915.83
7.1.70.0000.00717.38
7.1.60.0040.01519.23
7.1.00.0100.08722.54
7.0.200.0000.00916.45
7.0.60.0130.07721.88
7.0.50.0100.04317.80
7.0.40.0200.08320.25
7.0.30.0100.06320.14
7.0.20.0770.06020.26
7.0.10.1000.07720.17
7.0.00.0270.06019.99
5.6.280.0100.06720.78
5.6.210.0130.08020.51
5.6.200.0100.03718.08
5.6.190.0370.05020.77
5.6.180.0170.05720.63
5.6.170.0730.06720.54
5.6.160.0200.06020.39
5.6.150.0270.05320.51
5.6.140.0070.07020.11
5.6.130.0200.05720.33
5.6.120.0200.05320.43
5.6.110.0230.04720.32
5.6.100.0170.05720.09
5.6.90.0230.06020.09
5.6.80.0230.05019.83
5.6.70.0370.04319.88
5.6.60.0170.06319.75
5.6.50.0170.05719.77
5.6.40.0130.06019.72
5.6.30.0170.05719.78
5.6.20.0130.06019.77
5.6.10.0270.05019.82
5.6.00.0270.05019.74
5.5.350.0230.07320.41
5.5.340.0030.05017.89
5.5.330.0270.07020.25
5.5.320.0130.05720.10
5.5.310.0770.05320.10
5.5.300.0230.06020.17
5.5.290.0170.06320.19
5.5.280.0230.06719.91
5.5.270.0130.05720.17
5.5.260.0230.05320.21
5.5.250.0270.05020.09
5.5.240.0200.05319.49
5.5.230.0200.05319.46
5.5.220.0200.05319.51
5.5.210.0230.06319.69
5.5.200.0100.06019.30
5.5.190.0230.05019.63
5.5.180.0200.05319.52
5.5.160.0200.06319.60
5.5.150.0130.06319.56
5.5.140.0370.05719.60
5.5.130.0130.06019.65
5.5.120.0200.05719.25
5.5.110.0100.06319.29
5.5.100.0130.06019.48
5.5.90.0230.05719.56
5.5.80.0170.05719.50
5.5.70.0300.06719.41
5.5.60.0230.05319.52
5.5.50.0170.05719.14
5.5.40.0070.06719.33
5.5.30.0400.06019.32
5.5.20.0330.05019.44
5.5.10.0370.03719.46
5.5.00.0170.05719.40

preferences:
59.92 ms | 1777 KiB | 5 Q