3v4l.org

run code in 300+ PHP versions simultaneously
<?php class utils { private static function replace_unicode_escape_sequence($match) { return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); } public static to_decode($str) { return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', '$this->replace_unicode_escape_sequence', $str); } } $str = '{"name":"F\u00f6retag: Betalning"}'; echo utils::to_decode($str);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.290.0080.05012.51
5.4.280.0120.04112.41
5.4.270.0070.04512.41
5.4.260.0090.04512.41
5.4.250.0090.04712.41
5.4.240.0090.04912.41
5.4.230.0070.05612.40
5.4.220.0120.06912.40
5.4.210.0100.03812.40
5.4.200.0100.04312.40
5.4.190.0090.04312.40
5.4.180.0110.04912.40
5.4.170.0090.06312.41
5.4.160.0150.04312.40
5.4.150.0070.04212.40
5.4.140.0120.04012.09
5.4.130.0120.05312.07
5.4.120.0070.03612.03
5.4.110.0090.04412.03
5.4.100.0090.03912.03
5.4.90.0080.04712.03
5.4.80.0090.04212.03
5.4.70.0080.04212.02
5.4.60.0050.03612.03
5.4.50.0060.03812.03
5.4.40.0080.03912.01
5.4.30.0060.03912.01
5.4.20.0110.03512.01
5.4.10.0070.03812.01
5.4.00.0100.04611.51
5.3.280.0120.05412.71
5.3.270.0100.05512.72
5.3.260.0110.05112.72
5.3.250.0110.04512.72
5.3.240.0090.04112.72
5.3.230.0140.05612.71
5.3.220.0130.04712.68
5.3.210.0100.05212.68
5.3.200.0110.05612.68
5.3.190.0130.05412.68
5.3.180.0100.05712.67
5.3.170.0120.05012.67
5.3.160.0130.05012.67
5.3.150.0080.05412.67
5.3.140.0080.05612.66
5.3.130.0120.05112.66
5.3.120.0090.05412.66
5.3.110.0090.05412.66
5.3.100.0160.04412.12
5.3.90.0100.04312.10
5.3.80.0120.05612.09
5.3.70.0090.04712.09
5.3.60.0100.04612.08
5.3.50.0090.05112.02
5.3.40.0100.04612.03
5.3.30.0100.04711.98
5.3.20.0070.04711.76
5.3.10.0120.04711.73
5.3.00.0080.04111.72

preferences:
130.99 ms | 1394 KiB | 7 Q