3v4l.org

run code in 200+ PHP versions simultaneously
<?php $s = "01001010101101111011101001010100010101101010101010101101101010010110110110"; $n = 10; for( $i = $best = $bestCount = 0; ( ($count = @substr_count( $s, 1, $i, $n )) > $bestCount && (($best = $i) && ($bestCount = $count)) ) || $i < strlen($s); $i++ ); var_dump($i,$best,$bestCount);
based on cUvhX
Output for 5.1.0 - 7.4.6
int(74) int(10) int(8)
Output for 4.3.0 - 5.0.5
int(74) int(0) int(0)