3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ss = "\u{DF}"; var_dump(urlencode($ss)); var_dump(urlencode(utf8_decode($ss))); var_dump(json_encode(utf8_decode($ss))); // U+044F CYRILLIC SMALL LETTER YA $ya = "\u{44F}"; var_dump(urlencode($ya)); var_dump(urlencode(utf8_decode($ya))); var_dump(json_encode(utf8_decode($ya))); // Improperly formatted U+0041 LATIN CAPITAL LETTER A $A = "\xC1\x81"; var_dump(urlencode($A)); var_dump(urlencode(utf8_decode($A))); var_dump(json_encode(utf8_decode($A)));
Output for 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
string(6) "%C3%9F" Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 5 string(3) "%DF" Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 6 bool(false) string(6) "%D1%8F" Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 11 string(3) "%3F" Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 12 string(3) ""?"" string(6) "%C1%81" Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 17 string(6) "%3F%3F" Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 18 string(4) ""??""
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
string(6) "%C3%9F" string(3) "%DF" bool(false) string(6) "%D1%8F" string(3) "%3F" string(3) ""?"" string(6) "%C1%81" string(6) "%3F%3F" string(4) ""??""
Output for 5.2.15 - 5.2.17, 5.3.4 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
string(12) "%5Cu%7BDF%7D" string(12) "%5Cu%7BDF%7D" string(9) ""\\u{DF}"" string(13) "%5Cu%7B44F%7D" string(13) "%5Cu%7B44F%7D" string(10) ""\\u{44F}"" string(6) "%C1%81" string(6) "%3F%3F" string(4) ""??""
Output for 5.2.0 - 5.2.14, 5.3.0 - 5.3.3
string(12) "%5Cu%7BDF%7D" string(12) "%5Cu%7BDF%7D" string(9) ""\\u{DF}"" string(13) "%5Cu%7B44F%7D" string(13) "%5Cu%7B44F%7D" string(10) ""\\u{44F}"" string(6) "%C1%81" string(1) "A" string(3) ""A""
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
string(12) "%5Cu%7BDF%7D" string(12) "%5Cu%7BDF%7D" Fatal error: Call to undefined function json_encode() in /in/uPVK8 on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
string(12) "%5Cu%7BDF%7D" string(12) "%5Cu%7BDF%7D" Fatal error: Call to undefined function: json_encode() in /in/uPVK8 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
string(12) "%5Cu%7BDF%7D" string(12) "%5Cu%7BDF%7D" Fatal error: Call to undefined function: json_encode() in /in/uPVK8 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(12) "%5Cu%7BDF%7D" string(12) "%5Cu%7BDF%7D" Fatal error: Call to undefined function: json_encode() in /in/uPVK8 on line 6

preferences:
241.41 ms | 403 KiB | 397 Q