3v4l.org

run code in 500+ PHP versions simultaneously
<?php //echo '<pre>';print_r($sArray);echo '</pre>';die; function findRepeatingStringCount($sArray) { $i = 1; $left = $sArray[0]; $right = $sArray[$i]; while ($i < count($sArray)) { if ($left == $right) { return $i; } $i++; $right = $sArray[$i]; } return 0; } $s = "abcabcbb"; // string to array $sArray = str_split($s); echo '<pre>';print_r(findRepeatingStringCount($sArray));echo '</pre>';die; //abcabcbb //start index at 1 // l: a r: b // i=1 //l: a, r: c // i: 2
Output for git.master_jit, git.master
<pre>3</pre>

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:
46.78 ms | 746 KiB | 4 Q