3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = 'in the middle 9850112686331(14-15) for Rocco A & Stephanie'; $arr = explode(' ', $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)) . PHP_EOL; } } usort($candidates, function($a, $b) { return strlen($b) - strlen($a); }); print_r($candidates);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => in the middle 9850112686331(14-15) for Rocco A & Stephanie [1] => the middle 9850112686331(14-15) for Rocco A & Stephanie [2] => middle 9850112686331(14-15) for Rocco A & Stephanie [3] => in the middle 9850112686331(14-15) for Rocco A & [4] => in the middle 9850112686331(14-15) for Rocco A [5] => the middle 9850112686331(14-15) for Rocco A & [6] => in the middle 9850112686331(14-15) for Rocco [7] => 9850112686331(14-15) for Rocco A & Stephanie [8] => the middle 9850112686331(14-15) for Rocco A [9] => the middle 9850112686331(14-15) for Rocco [10] => middle 9850112686331(14-15) for Rocco A & [11] => middle 9850112686331(14-15) for Rocco A [12] => in the middle 9850112686331(14-15) for [13] => middle 9850112686331(14-15) for Rocco [14] => the middle 9850112686331(14-15) for [15] => in the middle 9850112686331(14-15) [16] => 9850112686331(14-15) for Rocco A & [17] => 9850112686331(14-15) for Rocco A [18] => the middle 9850112686331(14-15) [19] => middle 9850112686331(14-15) for [20] => 9850112686331(14-15) for Rocco [21] => middle 9850112686331(14-15) [22] => 9850112686331(14-15) for [23] => for Rocco A & Stephanie [24] => 9850112686331(14-15) [25] => Rocco A & Stephanie [26] => in the middle [27] => for Rocco A & [28] => A & Stephanie [29] => for Rocco A [30] => & Stephanie [31] => the middle [32] => for Rocco [33] => Rocco A & [34] => Stephanie [35] => Rocco A [36] => in the [37] => middle [38] => Rocco [39] => the [40] => for [41] => A & [42] => in [43] => A [44] => & )

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:
59.32 ms | 405 KiB | 8 Q