3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testStrings = [ "H3||0", "Hallo", "aloha", "h", "hallo", "hallå", "hel", "helicopter", "hellacious", "hello", "hello y'all", "hello yall", "helów", "hey hello", "hola", "hêllo", "mellow yellow", "try", ]; $needle = 'hello'; usort($testStrings, fn($a, $b) => levenshtein($needle, $a) <=> levenshtein($needle, $b) ?: similar_text($needle, $b) <=> similar_text($needle, $a) ); var_export($testStrings);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'hello', 1 => 'hallo', 2 => 'hêllo', 3 => 'Hallo', 4 => 'hel', 5 => 'hallå', 6 => 'helów', 7 => 'hola', 8 => 'hey hello', 9 => 'h', 10 => 'hellacious', 11 => 'hello yall', 12 => 'aloha', 13 => 'H3||0', 14 => 'try', 15 => 'hello y\'all', 16 => 'helicopter', 17 => 'mellow yellow', )

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:
31.04 ms | 402 KiB | 8 Q