3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '\u00c3\u0096sterreich'; $str = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function ($match) { return utf8_decode(mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE')); }, $str); print_r( $str);
Output for 8.4.1 - 8.4.12
Deprecated: Function utf8_decode() is deprecated since 8.2, visit the php.net documentation for various alternatives in /in/a6BG7 on line 6 Deprecated: Function utf8_decode() is deprecated since 8.2, visit the php.net documentation for various alternatives in /in/a6BG7 on line 6 Österreich
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.25
Deprecated: Function utf8_decode() is deprecated in /in/a6BG7 on line 6 Deprecated: Function utf8_decode() is deprecated in /in/a6BG7 on line 6 Österreich
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33
Österreich

preferences:
123.8 ms | 409 KiB | 5 Q