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

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.130.0090.00217.91
8.4.120.0060.00520.57
8.4.110.0110.00620.81
8.4.100.0050.00417.68
8.4.90.0120.00918.79
8.4.80.0110.00919.38
8.4.70.0150.00617.73
8.4.60.0140.00718.63
8.4.50.0110.00920.49
8.4.40.0180.00317.67
8.4.30.0090.00920.68
8.4.20.0160.00318.05
8.4.10.0130.00319.35
8.3.250.0040.00419.16
8.3.240.0130.00516.66
8.3.230.0140.00516.61
8.3.220.0100.00717.45
8.3.210.0140.00516.56
8.3.200.0130.00616.54
8.3.190.0100.01017.06
8.3.180.0090.01018.44
8.3.170.0070.01120.95
8.3.160.0090.00917.36
8.3.150.0070.01018.89
8.3.140.0060.00318.45
8.3.130.0060.00316.73
8.3.120.0090.00318.90
8.3.110.0060.00320.94
8.3.100.0030.00524.06
8.3.90.0070.00026.77
8.3.80.0030.00619.36
8.3.70.0070.00718.18
8.3.60.0120.00918.34
8.3.50.0040.01816.72
8.3.40.0100.01021.92
8.3.30.0030.01020.21
8.3.20.0160.00325.66
8.3.10.0160.00325.66
8.3.00.0150.00425.66
8.2.290.0100.00620.61
8.2.280.0100.00518.28
8.2.270.0110.00717.27
8.2.260.0110.00716.48
8.2.250.0100.00716.61
8.2.240.0070.00718.85
8.2.230.0040.00422.58
8.2.220.0060.00337.54
8.2.210.0070.00726.77
8.2.200.0030.00718.88
8.2.190.0160.00016.75
8.2.180.0180.00416.50
8.2.170.0120.00918.96
8.2.160.0100.00322.96
8.2.150.0100.01025.66
8.2.140.0040.01525.66
8.2.130.0060.01325.66
8.2.120.0060.01325.66
8.2.110.0060.01325.66
8.2.100.0190.00025.66
8.2.90.0080.00825.66
8.2.80.0120.00325.66
8.2.70.0160.00725.66
8.2.60.0100.01025.66
8.2.50.0100.00725.66
8.2.40.0060.00925.66
8.2.30.0150.00025.66
8.2.20.0130.00325.66
8.2.10.0120.00325.66
8.2.00.0030.01725.66
8.1.330.0070.00422.30
8.1.320.0140.00816.41
8.1.310.0000.00816.91
8.1.300.0040.00418.57
8.1.290.0040.00430.84
8.1.280.0110.01125.92
8.1.270.0170.00325.66
8.1.260.0120.00925.66
8.1.250.0100.01025.66
8.1.240.0100.00725.66
8.1.230.0070.01425.66
8.1.220.0180.00425.66
8.1.210.0110.00825.66
8.1.200.0120.00825.66
8.1.190.0090.00925.66
8.1.180.0140.00725.66
8.1.170.0130.00725.66
8.1.160.0130.00625.66
8.1.150.0090.00925.66
8.1.140.0130.00625.66
8.1.130.0170.00325.66
8.1.120.0060.01025.66
8.1.110.0100.01325.66
8.1.100.0070.01025.66
8.1.90.0180.00025.66
8.1.80.0070.01125.66
8.1.70.0120.00325.66
8.1.60.0160.00325.66
8.1.50.0140.00325.66
8.1.40.0140.00325.66
8.1.30.0060.01025.66
8.1.20.0120.00325.66
8.1.10.0110.00425.66
8.1.00.0040.01125.66

preferences:
27.36 ms | 403 KiB | 5 Q