3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "sea \u{200B}\u{200B}lion"; echo preg_replace_callback('#\X#u', function($m) { $utf16 = mb_convert_encoding($m[0], 'UTF-16BE', 'UTF-8'); if (strlen($utf16) <= 2) { $esc = '\u' . bin2hex($utf16); } else { $esc = '\u' . bin2hex(substr($utf16, 0, 2)) . '\u' . bin2hex(substr($utf16, 2, 2)); } return $esc; }, $input);

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)
8.5.10.0070.00118.43
8.5.00.0160.01120.45
8.4.150.0030.00014.05
8.4.140.0120.00917.77
8.4.130.0130.00718.09
8.4.120.0120.00620.85
8.4.110.0020.00722.61
8.4.100.0120.00818.09
8.4.90.0160.00520.68
8.4.80.0050.00418.83
8.4.70.0060.00318.91
8.4.60.0160.00520.49
8.4.50.0110.00818.89
8.4.40.0070.01319.76
8.4.30.0150.00422.69
8.4.20.0150.00318.96
8.4.10.0060.00319.50
8.3.280.0120.00818.64
8.3.270.0110.00816.73
8.3.260.0040.00517.00
8.3.250.0110.00718.73
8.3.240.0050.00416.73
8.3.230.0090.00916.75
8.3.220.0050.00319.05
8.3.210.0110.00716.88
8.3.200.0050.00316.89
8.3.190.0060.00319.00
8.3.180.0120.00618.95
8.3.170.0070.01322.54
8.3.160.0060.00919.18
8.3.150.0150.00317.29
8.3.140.0090.00920.67
8.3.130.0110.00418.48
8.3.120.0080.01118.92
8.3.110.0060.00320.94
8.3.100.0070.00324.06
8.3.90.0110.00026.77
8.3.80.0060.00317.97
8.3.70.0040.01218.68
8.3.60.0070.01118.43
8.3.50.0050.01022.18
8.3.40.0170.00318.80
8.3.30.0130.00618.95
8.3.20.0040.00420.85
8.3.10.0030.00520.00
8.3.00.0080.00023.66
8.2.290.0110.00718.80
8.2.280.0120.00618.86
8.2.270.0140.00717.16
8.2.260.0040.01117.24
8.2.250.0120.00617.02
8.2.240.0000.00819.09
8.2.230.0000.01022.58
8.2.220.0050.00337.54
8.2.210.0080.00026.77
8.2.200.0050.00516.75
8.2.190.0140.00716.88
8.2.180.0120.00318.79
8.2.170.0090.00622.96
8.2.160.0060.00822.21
8.2.150.0040.00425.66
8.2.140.0080.00424.66
8.2.130.0030.00526.16
8.2.120.0080.00026.16
8.2.110.0000.00919.27
8.2.100.0070.00318.16
8.2.90.0040.00420.51
8.2.80.0030.00618.34
8.2.70.0050.00318.16
8.2.60.0040.00418.31
8.2.50.0090.00318.10
8.2.40.0040.00419.55
8.2.30.0040.00419.50
8.2.20.0040.00418.41
8.2.10.0000.00819.56
8.2.00.0000.00819.55
8.1.330.0070.01123.71
8.1.320.0130.00718.36
8.1.310.0080.00018.61
8.1.300.0060.01219.75
8.1.290.0100.00030.84
8.1.280.0090.00625.92
8.1.270.0050.00322.05
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00321.98
8.1.230.0130.00020.95
8.1.220.0030.00517.79
8.1.210.0000.00819.08
8.1.200.0100.00017.60
8.1.190.0030.00517.61
8.1.180.0040.00418.10
8.1.170.0040.00418.91
8.1.160.0030.00619.01
8.1.150.0040.00419.04
8.1.140.0050.00319.04
8.1.130.0000.00720.28
8.1.120.0070.00017.68
8.1.110.0040.00817.58
8.1.100.0000.00717.68
8.1.90.0050.00217.56
8.1.80.0060.00317.73
8.1.70.0000.00717.64
8.1.60.0050.00317.81
8.1.50.0040.00417.67
8.1.40.0000.01017.68
8.1.30.0000.00917.88
8.1.20.0040.00417.89
8.1.10.0000.00717.77
8.1.00.0000.00717.75
8.0.300.0070.00020.10
8.0.290.0000.00717.13
8.0.280.0000.00718.61
8.0.270.0030.00317.34
8.0.260.0000.00820.45
8.0.250.0030.00317.16
8.0.240.0030.00317.26
8.0.230.0040.00417.31
8.0.220.0040.00317.18
8.0.210.0050.00317.14
8.0.200.0070.00017.29
8.0.190.0040.00417.30
8.0.180.0040.00417.26
8.0.170.0000.00917.14
8.0.160.0050.00317.22
8.0.150.0040.00417.16
8.0.140.0000.00717.26
8.0.130.0000.00613.66
8.0.120.0000.00817.18
8.0.110.0030.00517.15
8.0.100.0000.00717.24
8.0.90.0000.00917.23
8.0.80.0110.00717.20
8.0.70.0000.00717.18
8.0.60.0040.00417.11
8.0.50.0040.00417.11
8.0.30.0100.00717.50
8.0.20.0100.01417.20
8.0.10.0000.00717.09
8.0.00.0080.01117.10
7.4.330.0000.00615.55
7.4.320.0060.00016.95
7.4.300.0030.00316.91
7.4.290.0000.00716.91
7.4.280.0030.00516.90
7.4.270.0000.00816.91
7.4.260.0040.00416.88
7.4.250.0080.00016.85
7.4.240.0030.00416.88
7.4.230.0050.00216.98
7.4.220.0030.00316.75
7.4.210.0100.00816.94
7.4.200.0030.00316.99
7.4.140.0030.01317.86
7.4.130.0100.00716.71
7.4.120.0030.01316.65
7.4.110.0110.01716.85
7.4.100.0120.00616.82
7.4.90.0100.00716.77
7.4.80.0140.00719.39
7.4.70.0060.01016.84
7.4.60.0060.00916.92
7.4.50.0030.01316.49
7.4.40.0060.01216.93
7.4.00.0000.01815.38
7.3.330.0050.00013.52
7.3.320.0000.00613.54
7.3.310.0000.00816.60
7.3.300.0040.00416.64
7.3.290.0070.00016.65
7.3.280.0040.01116.57
7.3.260.0110.00916.72
7.3.240.0100.00916.71
7.3.230.0100.01016.87
7.3.210.0130.00316.65
7.3.200.0130.00316.79
7.3.190.0060.01216.54
7.3.180.0130.00316.52
7.3.170.0140.00416.71
7.3.160.0120.00916.75
7.3.120.0070.01015.12
7.3.110.0120.00315.02
7.3.100.0000.01414.87
7.3.90.0130.00315.00
7.3.80.0070.01014.91
7.3.70.0030.01414.93
7.3.60.0050.00514.95
7.3.50.0080.00515.06
7.3.40.0070.00914.94
7.3.30.0030.00914.83
7.3.20.0110.00616.91
7.3.10.0100.00216.71
7.3.00.0160.00316.86
7.2.330.0060.01616.82
7.2.320.0130.01016.90
7.2.310.0060.01616.90
7.2.300.0090.00916.84
7.2.290.0080.01116.93
7.2.240.0030.00915.32
7.2.230.0100.00715.43
7.2.220.0040.01215.41
7.2.210.0090.00915.27
7.2.200.0040.01115.02
7.2.190.0080.01215.17
7.2.180.0070.01015.17
7.2.170.0080.00915.26
7.2.160.0060.00915.30
7.2.150.0140.00617.12
7.2.140.0020.01417.28
7.2.130.0080.00817.13
7.2.120.0050.00917.04
7.2.110.0070.00816.97
7.2.100.0070.00817.20
7.2.90.0030.01317.12
7.2.80.0090.00716.95
7.2.70.0130.00817.07
7.2.60.0040.01417.20
7.2.50.0080.01116.92
7.2.40.0080.00816.99
7.2.30.0050.01117.25
7.2.20.0140.00517.16
7.2.10.0080.00817.07
7.2.00.0080.01217.06
7.1.330.0100.00716.29
7.1.320.0060.01016.23
7.1.310.0040.00816.08
7.1.300.0090.00816.02
7.1.290.0060.00916.03
7.1.280.0100.00815.72
7.1.270.0110.00315.80
7.1.260.0110.00515.89
7.1.250.0060.00816.05

preferences:
38.11 ms | 403 KiB | 5 Q