3v4l.org

run code in 300+ PHP versions simultaneously
<?php $suggestedMunicipalities = [ 'Bělá nad Radbuzou', 'Bělá nad Svitavou', ]; usort($suggestedMunicipalities, function (array $a, array $b) use ($query) { $aDistance = levenshtein($query, $a, 1, 1000, 1000); $bDistance = levenshtein($query, $b, 1, 1000, 1000); return $aDistance - $bDistance; }); var_dump($suggestedMunicipalities);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $query in /in/6WgKH on line 8 Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($a) must be of type array, string given in /in/6WgKH:8 Stack trace: #0 [internal function]: {closure}('B\xC4\x9Bl\xC3\xA1 nad Radb...', 'B\xC4\x9Bl\xC3\xA1 nad Svit...') #1 /in/6WgKH(8): usort(Array, Object(Closure)) #2 {main} thrown in /in/6WgKH on line 8
Process exited with code 255.

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