3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = '/dav/files/admin/%C3%BC%C3%B6%C3%A4%C3%B6%C3%A4%C3%BC%C3%B6%C3%A4%C3%BB%C5%B7%C3%AE'; /** * 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; } var_dump( decodePathSegment($str));
Output for 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Deprecated: Function utf8_encode() is deprecated since 8.2, visit the php.net documentation for various alternatives in /in/IT9dJ on line 15 string(61) "/dav/files/admin/üöäöäüöäûŷî"
Output for 8.2.0 - 8.2.30, 8.3.0 - 8.3.30
Deprecated: Function utf8_encode() is deprecated in /in/IT9dJ on line 15 string(61) "/dav/files/admin/üöäöäüöäûŷî"
Output for 8.1.0 - 8.1.34
string(61) "/dav/files/admin/üöäöäüöäûŷî"
Output for 7.2.34, 7.4.0 - 7.4.33, 8.0.1 - 8.0.30
string(39) "/dav/files/admin/üöäöäüöäûŷî"

preferences:
118.92 ms | 1257 KiB | 4 Q