3v4l.org

run code in 300+ 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);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) in /in/uJd9E:6 Stack trace: #0 /in/uJd9E(6): substr_count('010010101011011...', '1', 65, 10) #1 {main} thrown in /in/uJd9E on line 6
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
66.46 ms | 401 KiB | 8 Q