3v4l.org

run code in 200+ PHP versions simultaneously
<?php $s = "01001010101101111011101001010100010101101010101010101101101010010110110110"; $n = 10; for($a=$b=$c=0;(($d=@substr_count($s,1,$a,$n))>$c&&(($b=$a)&&($c=$d)))||$a<strlen($s);$a++);echo $b;
based on dQ7Qi

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)
7.4.00.0040.01315.10
7.3.120.0040.01114.82
7.3.110.0130.00314.97
7.3.100.0000.01514.90
7.3.90.0080.00414.50
7.3.80.0070.00714.80
7.3.70.0030.01014.82
7.3.60.0120.00014.74
7.3.50.0000.01014.78
7.3.40.0030.00614.84
7.3.30.0110.00714.64
7.3.20.0040.00716.62
7.3.10.0060.00916.47
7.3.00.0080.00316.70
7.2.250.0090.00915.17
7.2.240.0090.00915.00
7.2.230.0070.00715.00
7.2.220.0080.00415.27
7.2.210.0070.00314.95
7.2.200.0040.01114.91
7.2.190.0060.00815.08
7.2.180.0000.01314.82
7.2.170.0030.01015.09
7.2.60.0000.01216.96
7.2.00.0060.00919.45
7.1.330.0000.01315.69
7.1.320.0030.01015.67
7.1.310.0030.00715.71
7.1.300.0070.01115.82
7.1.290.0060.00315.74
7.1.280.0070.00715.91
7.1.270.0030.01115.91
7.1.260.0030.00615.59
7.1.200.0070.00715.89
7.1.100.0070.00418.29
7.1.70.0000.01116.97
7.1.60.0070.01019.29
7.1.50.0130.01016.79
7.1.00.0070.07322.45
7.0.200.0740.00314.63
7.0.140.0030.05721.97
7.0.60.0070.07019.96
7.0.50.0000.04317.81
7.0.40.0200.07720.23
7.0.30.0230.04320.13
7.0.20.0430.07320.13
7.0.10.0030.06020.01
7.0.00.0130.04720.20
5.6.280.0130.06321.06
5.6.210.0070.06720.74
5.6.200.0170.07018.17
5.6.190.0170.03320.60
5.6.180.0470.07020.41
5.6.170.1170.05020.52
5.6.160.0100.06720.44
5.6.150.0030.06018.21
5.6.140.0100.08018.22
5.6.130.0030.06018.13
5.6.120.0030.06720.96
5.6.110.0030.08320.98
5.6.100.0030.06720.95
5.6.90.0000.05020.99
5.6.80.0170.07020.50
5.5.350.0230.06320.32
5.5.340.0030.04317.99
5.5.330.0030.05020.20
5.5.320.0370.07320.41
5.5.310.0170.05020.50
5.5.300.0100.04317.98
5.5.290.0000.06317.91
5.5.280.0000.09320.82
5.5.270.0100.04020.74
5.5.260.0070.06320.88
5.5.250.0000.04320.77
5.5.240.0070.05320.35
5.4.450.0770.05719.64
5.4.440.0430.05719.63
5.4.430.0030.06319.42
5.4.420.0030.06019.35
5.4.410.0100.05319.38
5.4.400.0000.06319.21
5.4.390.0000.06019.06
5.4.380.0200.05318.77
5.4.370.0230.07018.62
5.4.360.0300.05718.74
5.4.350.0130.04713.72
5.4.340.0130.04713.72
5.4.320.0430.03314.14
5.4.310.0170.05014.20
5.4.300.0100.05314.16
5.4.290.0130.05014.29
5.4.280.0170.04314.09
5.4.270.0200.04314.10
5.4.260.0170.05314.03
5.4.250.0100.05314.06
5.4.240.0170.06314.09
5.4.230.0270.04014.20
5.4.220.0270.05714.11
5.4.210.0270.04714.17
5.4.200.0330.05014.00
5.4.190.0370.04014.16
5.4.180.0070.05714.04
5.4.170.0070.06014.04
5.4.160.0000.05714.08
5.4.150.0370.04714.03
5.4.140.0400.03013.79
5.4.130.0200.04313.70
5.4.120.0270.04713.64
5.4.110.0230.04713.70
5.4.100.0300.03013.82
5.4.90.0300.07013.82
5.4.80.0030.05713.88
5.4.70.0170.04313.68
5.4.60.0100.05713.73
5.4.50.0100.04713.66
5.4.40.0200.04013.63
5.4.30.0200.04013.78
5.4.20.0170.05013.67
5.4.10.0100.04713.86
5.4.00.0330.04013.14
5.3.290.0130.05314.53
5.3.280.0200.04014.61
5.3.270.0130.04714.53
5.3.260.0200.04714.55
5.3.250.0170.04314.64
5.3.240.0130.05014.52
5.3.230.0200.04714.48
5.3.220.0270.04714.41
5.3.210.0230.04014.60
5.3.200.0130.04314.49
5.3.190.0030.05314.43
5.3.180.0100.04014.53
5.3.170.0130.03714.45
5.3.160.0230.03014.53
5.3.150.0070.04014.43
5.3.140.0030.04314.58
5.3.130.0130.04714.55
5.3.120.0070.05014.58
5.3.110.0000.06314.55
5.3.100.0130.03714.04
5.3.90.0170.03313.92
5.3.80.0170.04014.05
5.3.70.0170.04314.00
5.3.60.0070.05314.03
5.3.50.0300.04714.00
5.3.40.0130.04713.96
5.3.30.0100.05313.94
5.3.20.0130.04313.59
5.3.10.0200.04313.55
5.3.00.0170.04313.58
5.2.170.0230.04011.23
5.2.160.0070.03711.04
5.2.150.0100.03011.10
5.2.140.0100.03711.03
5.2.130.0030.04711.02
5.2.120.0070.04310.97
5.2.110.0170.03011.07
5.2.100.0130.03711.11
5.2.90.0230.03011.07
5.2.80.0100.04011.01
5.2.70.0070.04311.17
5.2.60.0030.04711.05
5.2.50.0030.04711.02
5.2.40.0130.03310.86
5.2.30.0100.04010.94
5.2.20.0070.04010.96
5.2.10.0070.04010.91
5.2.00.0100.03710.89
5.1.60.0030.03710.03
5.1.50.0070.03310.11
5.1.40.0030.0379.91
5.1.30.0100.03710.32
5.1.20.0230.02310.26
5.1.10.0100.03010.10
5.1.00.0200.03310.04
5.0.50.0030.0278.70
5.0.40.0030.0238.55
5.0.30.0070.0308.19
5.0.20.0030.0208.16
5.0.10.0070.0208.11
5.0.00.0000.0378.09
4.4.90.0030.0175.86
4.4.80.0030.0205.81
4.4.70.0130.0075.83
4.4.60.0030.0235.88
4.4.50.0000.0205.80
4.4.40.0070.0275.82
4.4.30.0100.0105.86
4.4.20.0000.0235.98
4.4.10.0070.0175.89
4.4.00.0000.0305.86
4.3.110.0000.0235.82
4.3.100.0030.0175.75
4.3.90.0070.0175.76
4.3.80.0030.0305.74
4.3.70.0100.0205.76
4.3.60.0030.0205.73
4.3.50.0070.0175.76
4.3.40.0100.0375.81
4.3.30.0070.0174.54
4.3.20.0030.0204.48
4.3.10.0030.0204.47
4.3.00.0000.0236.73