3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "Ham followed now ecstatic use speaking exercise may repeated. Himself he evident oh greatly my on inhabit general concern. It allowance prevailed enjoyment in it. Calling observe for who pressed raising his. Can connection instrument astonished unaffected his motionless preference. Announcing say boy precaution unaffected difficulty alteration him."; function countt($text, $word, $count = 0) { $found = ''; for ($i = 0; $i < strlen($word); $i++) { for ($j = 0; $j < strlen($text); $j++) { if ($word[$i] === $text[$j]) { $text = substr($text, 0, $j) . substr($text, $j + 1); $found .= $word[$i]; if ($found === $word) { $count++; return countt($text, $word, $count); } break; } } } return $count; } echo countt($text, 'potato');//6
Output for git.master_jit, git.master, rfc.property-hooks
6

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:
52.53 ms | 405 KiB | 5 Q