3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = 'in the middle 9850112686331(14-15): for Rocco A & Stephanie'; $arr = preg_split('/[^[:alnum:]]+/', $subject); $candidates = []; for ($i = 0; $i < count($arr); $i++) { for ($j = $i; $j < count($arr); $j++) { $candidates[] = implode(' ', array_slice($arr, $i, $j - $i + 1)); } } usort($candidates, function($a, $b) { return strlen($b) - strlen($a); }); foreach($candidates as $candidate){ echo $candidate . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
in the middle 9850112686331 14 15 for Rocco A Stephanie the middle 9850112686331 14 15 for Rocco A Stephanie middle 9850112686331 14 15 for Rocco A Stephanie in the middle 9850112686331 14 15 for Rocco A in the middle 9850112686331 14 15 for Rocco the middle 9850112686331 14 15 for Rocco A 9850112686331 14 15 for Rocco A Stephanie the middle 9850112686331 14 15 for Rocco middle 9850112686331 14 15 for Rocco A in the middle 9850112686331 14 15 for middle 9850112686331 14 15 for Rocco the middle 9850112686331 14 15 for in the middle 9850112686331 14 15 9850112686331 14 15 for Rocco A in the middle 9850112686331 14 the middle 9850112686331 14 15 middle 9850112686331 14 15 for 9850112686331 14 15 for Rocco in the middle 9850112686331 the middle 9850112686331 14 14 15 for Rocco A Stephanie middle 9850112686331 14 15 the middle 9850112686331 15 for Rocco A Stephanie middle 9850112686331 14 9850112686331 14 15 for for Rocco A Stephanie middle 9850112686331 9850112686331 14 15 14 15 for Rocco A Rocco A Stephanie 9850112686331 14 14 15 for Rocco 15 for Rocco A in the middle 9850112686331 15 for Rocco for Rocco A A Stephanie the middle 14 15 for for Rocco Stephanie Rocco A in the middle 15 for 14 15 Rocco the for in 14 15 A

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:
61.6 ms | 403 KiB | 8 Q