3v4l.org

run code in 500+ PHP versions simultaneously
<?php //echo '<pre>';print_r($sArray);echo '</pre>';die; function findRepeatingStringCount($sArray) { $i = 0; $left = $sArray[0]; $right = $sArray[0]; while ($i < count($sArray)) { if ($left == $right) { return $i + 1; } $i++; $right = $sArray[$i]; } return 0; } $s = "abcabcbb"; // string to array $sArray = str_split($s); echo '<pre>';print_r(findRepeatingStringCount($sArray));echo '</pre>';die;
Output for git.master_jit, git.master
<pre>1</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:
50.81 ms | 745 KiB | 4 Q