3v4l.org

run code in 300+ PHP versions simultaneously
<?php $orig = 'welcome-to-your-world-42'; //$orig = 'welcome'; $parts = explode('-', $orig); if (1 < count($parts)) { usort($parts, function($a, $b) { return strlen($a) < strlen($b); }); $s1 = array_shift($parts); $s2 = array_shift($parts); } else { $s1 = $s2 = $orig; } echo $s1 . PHP_EOL . $s2;
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in /in/7IQEP on line 7 welcome world

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:
62.27 ms | 401 KiB | 8 Q