3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strs = [ 'Ostroměr', 'Šventaragis', 'Świętopełk', 'Dušan', 'Živko', ]; /** * Decodes a url-encoded path segment. */ function decodePathSegment(string $path): string { $path = rawurldecode($path); $encoding = mb_detect_encoding($path, ['UTF-8', 'ISO-8859-1']); switch ($encoding) { case 'ISO-8859-1': $path = utf8_encode($path); } return $path; } foreach($strs as $str) { var_dump(decodePathSegment($str)); }
Output for git.master_jit, git.master, rfc.property-hooks
string(9) "Ostroměr" string(12) "Šventaragis" string(13) "Świętopełk" string(6) "Dušan" string(6) "Živko"

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:
137.61 ms | 405 KiB | 5 Q