3v4l.org

run code in 300+ PHP versions simultaneously
<?php function unicodeToHtmlEntities($string) { $result = ''; $length = mb_strlen($string); for ($i = 0; $i < $length; $i++) { $result .= '&#' . chr(mb_substr($string, $i, 1)) . ';'; } return $result; } function unicodeToHtmlEntities2($string) { $result = ''; $length = strlen($string); for ($i = 0; $i < $length; $i++) { $result .= '&#' . ord(substr($string, $i, 1)) . ';'; } return $result; } echo unicodeToHtmlEntities('йцук');

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.3.70.0110.01116.63
8.3.60.0040.01118.30
8.3.50.0120.00722.01
8.3.40.0080.00618.79
8.3.30.0070.00719.09
8.3.20.0080.00018.71
8.3.10.0000.00723.36
8.3.00.0030.00619.20
8.2.180.0040.01817.00
8.2.170.0070.00722.96
8.2.160.0100.00320.50
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0050.00319.71
8.2.110.0090.00019.24
8.2.100.0090.00317.84
8.2.90.0040.00819.64
8.2.80.0000.00819.40
8.2.70.0040.00417.49
8.2.60.0050.00317.80
8.2.50.0060.00318.07
8.2.40.0000.00718.33
8.2.30.0000.00718.00
8.2.20.0000.00717.64
8.2.10.0040.00418.00
8.2.00.0080.00017.97
8.1.280.0100.01025.92
8.1.270.0080.00020.38
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.48
8.1.230.0070.00721.04
8.1.220.0060.00317.74
8.1.210.0030.00618.84
8.1.200.0060.00317.23
8.1.190.0030.00617.41
8.1.180.0060.00318.10
8.1.170.0030.00518.90
8.1.160.0110.00018.89
8.1.150.0000.00718.79
8.1.140.0000.00717.27
8.1.130.0000.00717.84
8.1.120.0030.00417.27
8.1.110.0000.00717.25
8.1.100.0030.00717.35
8.1.90.0070.00017.35
8.1.80.0070.00017.24
8.1.70.0040.00417.40
8.1.60.0040.00417.54
8.1.50.0030.00617.59
8.1.40.0040.00717.59
8.1.30.0030.00517.61
8.1.20.0070.00017.75
8.1.10.0040.00417.63
8.1.00.0000.00817.58
8.0.300.0040.00419.98
8.0.290.0040.00416.75
8.0.280.0030.00318.47
8.0.270.0030.00317.32
8.0.260.0000.00717.30
8.0.250.0030.00316.92
8.0.240.0070.00017.07
8.0.230.0090.00016.98
8.0.220.0000.00716.95
8.0.210.0000.00716.95
8.0.200.0030.00317.09
8.0.190.0000.00717.07
8.0.180.0070.00017.07
8.0.170.0040.00416.87
8.0.160.0000.00817.00
8.0.150.0070.00016.89
8.0.140.0030.00716.96
8.0.130.0000.00513.39
8.0.120.0040.00416.79
8.0.110.0030.00316.86
8.0.100.0000.00716.95
8.0.90.0000.00716.77
8.0.80.0100.00616.96
8.0.70.0000.00716.99
8.0.60.0080.00016.91
8.0.50.0070.00017.02
8.0.30.0110.00817.04
8.0.20.0070.01317.40
8.0.10.0030.00516.81
8.0.00.0070.01216.86
7.4.330.0050.00015.03
7.4.320.0030.00316.55
7.4.300.0030.00316.61
7.4.290.0000.00616.61
7.4.280.0000.00816.52
7.4.270.0000.00716.58
7.4.260.0040.00416.58
7.4.250.0080.00016.38
7.4.240.0040.00416.54
7.4.230.0040.00416.30
7.4.220.0040.01316.64
7.4.210.0030.01316.51
7.4.200.0000.00716.60
7.4.160.0160.00016.37
7.4.150.0110.00617.40
7.4.140.0120.00917.86
7.4.130.0160.00616.41
7.4.120.0120.00916.62
7.4.110.0030.01516.53
7.4.100.0170.00916.37
7.4.90.0070.01016.50
7.4.80.0100.01319.39
7.4.70.0040.01316.70
7.4.60.0060.01016.56
7.4.50.0080.00016.39
7.4.40.0000.01716.47
7.4.30.0120.00916.61
7.4.10.0030.01415.01
7.4.00.0090.00615.15
7.3.330.0000.00513.14
7.3.320.0030.00313.31
7.3.310.0030.00316.29
7.3.300.0020.00516.30
7.3.290.0070.00716.30
7.3.280.0100.00716.36
7.3.270.0080.00817.40
7.3.260.0120.00616.59
7.3.240.0080.00916.48
7.3.230.0110.00716.59
7.3.210.0000.01616.63
7.3.200.0090.00919.39
7.3.190.0030.01416.40
7.3.180.0090.00616.62
7.3.170.0030.01816.48
7.3.160.0140.00316.39
7.3.130.0070.01114.80
7.3.120.0090.00914.83
7.3.110.0080.01014.64
7.3.100.0060.01214.72
7.3.90.0050.00914.65
7.3.80.0080.00714.71
7.3.70.0040.00914.86
7.3.60.0060.00714.81
7.3.50.0090.00414.72
7.3.40.0050.00714.71
7.3.30.0090.00114.71
7.3.20.0110.00616.62
7.3.10.0060.00516.51
7.3.00.0060.00716.50
7.2.330.0160.00316.78
7.2.320.0090.00916.72
7.2.310.0150.00616.52
7.2.300.0040.01116.75
7.2.290.0030.01716.58
7.2.260.0100.00715.20
7.2.250.0080.00915.00
7.2.240.0020.01515.01
7.2.230.0100.00514.97
7.2.220.0040.01315.12
7.2.210.0060.01315.19
7.2.200.0030.01115.08
7.2.190.0020.01014.86
7.2.180.0060.00715.08
7.2.170.0060.00615.19
7.2.160.0070.00814.96
7.2.150.0020.01316.84
7.2.140.0070.00716.82
7.2.130.0040.00617.01
7.2.120.0060.00916.86
7.2.110.0060.00816.95
7.2.100.0020.01216.72
7.2.90.0060.00516.95
7.2.80.0040.01116.96
7.2.70.0100.00716.84
7.2.60.0070.00717.00
7.2.50.0020.01516.97
7.2.40.0080.00616.99
7.2.30.0090.00816.89
7.2.20.0040.01116.91
7.2.10.0050.00716.94
7.2.00.0060.00817.91
7.1.330.0040.01015.97
7.1.320.0070.01015.75
7.1.310.0060.00615.76
7.1.300.0030.00615.85
7.1.290.0060.00815.53
7.1.280.0060.00415.68
7.1.270.0100.00615.50
7.1.260.0030.01115.71
7.1.250.0050.00615.62
7.1.240.0090.00615.77
7.1.230.0030.01115.78
7.1.220.0030.01015.56
7.1.210.0030.01115.62
7.1.200.0060.00715.72
7.1.190.0020.01515.81
7.1.180.0050.00915.75
7.1.170.0030.01215.89
7.1.160.0050.00915.83
7.1.150.0110.00315.80
7.1.140.0060.00515.71
7.1.130.0060.00715.60
7.1.120.0070.00615.87
7.1.110.0030.01015.80
7.1.100.0060.00716.48
7.1.90.0070.00715.79
7.1.80.0030.01015.86
7.1.70.0050.00616.31
7.1.60.0100.00317.06
7.1.50.0100.00516.20
7.1.40.0080.00715.82
7.1.30.0030.00815.82
7.1.20.0020.01115.92
7.1.10.0070.00715.79
7.1.00.0050.03018.05
7.0.330.0070.00615.35
7.0.320.0040.00615.38
7.0.310.0050.00515.44
7.0.300.0060.00815.46
7.0.290.0060.00515.16
7.0.280.0040.00915.38
7.0.270.0050.00815.34
7.0.260.0030.01015.17
7.0.250.0070.00615.30
7.0.240.0050.00715.36
7.0.230.0050.00715.38
7.0.220.0030.00615.53
7.0.210.0050.00815.33
7.0.200.0060.00615.80
7.0.190.0070.00515.53
7.0.180.0020.01215.46
7.0.170.0030.01215.46
7.0.160.0040.01215.45
7.0.150.0100.00115.41
7.0.140.0030.00715.44
7.0.130.0000.01115.37
7.0.120.0050.01015.34
7.0.110.0100.00615.39
7.0.100.0060.00315.37
7.0.90.0060.00915.35
7.0.80.0050.00815.21
7.0.70.0030.01015.45
7.0.60.0080.02916.93
7.0.50.0080.03016.15
7.0.40.0060.01815.70
7.0.30.0230.02515.65
7.0.20.0100.02115.81
7.0.10.0180.02315.49
7.0.00.0040.03615.76
5.6.400.0040.00814.29
5.6.390.0080.00714.58
5.6.380.0070.00814.37
5.6.370.0030.01314.58
5.6.360.0040.01214.39
5.6.350.0020.01114.21
5.6.340.0100.00514.59
5.6.330.0040.01014.33
5.6.320.0070.00914.16
5.6.310.0000.01314.53
5.6.300.0100.00514.31
5.6.290.0100.00414.37
5.6.280.0030.02916.63
5.6.270.0060.00614.47
5.6.260.0050.00914.31
5.6.250.0070.00414.39
5.6.240.0080.00414.45
5.6.230.0010.00814.31
5.6.220.0090.00514.26
5.6.210.0110.01916.43
5.6.200.0050.02015.56
5.6.190.0020.03516.46
5.6.180.1450.02016.43
5.6.170.0130.03316.46
5.6.160.0080.01716.29
5.6.150.0060.03315.44
5.6.140.0080.01515.63
5.6.130.0050.02915.70
5.6.120.0070.02216.62
5.6.110.0070.02516.59
5.6.100.0040.03316.53
5.6.90.0070.03416.50
5.6.80.0030.03316.37
5.6.70.0060.03116.28
5.6.60.0050.00714.18
5.6.50.0040.01014.25
5.6.40.0040.00914.37
5.6.30.0020.01414.36
5.6.20.0050.00814.23
5.6.10.0050.00714.34
5.6.00.0100.00314.41
5.5.380.0030.00914.27
5.5.370.0050.00714.20
5.5.360.0050.00614.32
5.5.350.0080.03716.34
5.5.340.0040.01915.64
5.5.330.0070.02916.24
5.5.320.0110.02616.38
5.5.310.0110.02116.36
5.5.300.0050.02115.55
5.5.290.0050.03015.60
5.5.280.0080.03316.37
5.5.270.0050.03416.45
5.5.260.0030.03416.40
5.5.250.0040.02916.44
5.5.240.0090.03216.29
5.5.230.0040.01114.08
5.5.220.0060.00814.08
5.5.210.0090.00514.24
5.5.200.0090.00614.16
5.5.190.0070.00614.14
5.5.180.0000.01114.44
5.5.170.0050.00714.17
5.5.160.0070.00414.16
5.5.150.0050.00914.11
5.5.140.0060.00914.31
5.5.130.0030.00814.42
5.5.120.0060.00614.38
5.5.110.0070.00514.26
5.5.100.0040.00914.33
5.5.90.0030.00814.19
5.5.80.0060.00913.93
5.5.70.0040.00714.33
5.5.60.0050.01114.21
5.5.50.0060.00913.91
5.5.40.0070.00714.20
5.5.30.0040.01214.25
5.5.20.0090.00714.25
5.5.10.0070.00614.06
5.5.00.0060.00514.21
5.4.450.0110.02013.83
5.4.440.0060.02613.88
5.4.430.0080.01913.95
5.4.420.0100.02013.86
5.4.410.0100.02613.87
5.4.400.0030.03113.74
5.4.390.0090.02013.85
5.4.380.0090.02213.88
5.4.370.0080.02113.68
5.4.360.0090.01913.78
5.4.350.0060.02713.67
5.4.340.0030.02913.85
5.4.330.0070.00511.09
5.4.320.0070.02213.79
5.4.310.0060.03013.80
5.4.300.0100.02113.70
5.4.290.0060.02313.80
5.4.280.0080.01913.83
5.4.270.0080.02013.79
5.4.260.0090.01813.86
5.4.250.0040.02413.75
5.4.240.0040.02613.71
5.4.230.0090.02113.74
5.4.220.0080.02213.77
5.4.210.0090.01713.75
5.4.200.0060.02213.07
5.4.190.0080.02113.79
5.4.180.0070.02413.83
5.4.170.0060.02413.75
5.4.160.0050.02113.72
5.4.150.0040.02213.69
5.4.140.0050.02912.93
5.4.130.0080.01912.92
5.4.120.0060.02112.87
5.4.110.0070.01812.87
5.4.100.0080.01912.95
5.4.90.0070.02312.89
5.4.80.0050.02113.01
5.4.70.0070.01912.91
5.4.60.0070.02012.88
5.4.50.0070.02212.90
5.4.40.0060.02112.99
5.4.30.0060.02212.94
5.4.20.0060.02112.90
5.4.10.0050.02112.88
5.4.00.0090.01712.65
5.3.290.0000.06314.58
5.3.280.0070.05714.64
5.3.270.0170.05714.77
5.3.260.0070.05314.65
5.3.250.0030.05714.51
5.3.240.0070.05314.53
5.3.230.0170.05314.67
5.3.220.0100.05014.48
5.3.210.0100.05314.52
5.3.200.0130.04714.64
5.3.190.0030.05714.63
5.3.180.0070.05314.50
5.3.170.0070.05314.59
5.3.160.0030.08014.63
5.3.150.0070.05714.58
5.3.140.0030.06014.57
5.3.130.0100.05314.55
5.3.120.0130.05314.58
5.3.110.0170.05014.46
5.3.100.0100.05014.15
5.3.90.0030.05714.07
5.3.80.0170.05314.13
5.3.70.0130.04713.92
5.3.60.0130.05014.00
5.3.50.0070.06713.94
5.3.40.0070.05714.02
5.3.30.0100.06713.84
5.3.20.0030.06313.80
5.3.10.0100.05013.77
5.3.00.0170.04713.63
5.2.170.0070.04311.14
5.2.160.0170.04711.12
5.2.150.0100.04311.21
5.2.140.0100.04011.13
5.2.130.0070.04011.09
5.2.120.0070.04310.96
5.2.110.0130.03310.96
5.2.100.0100.04011.09
5.2.90.0070.04311.12
5.2.80.0100.04311.05
5.2.70.0100.03711.25
5.2.60.0030.04711.12
5.2.50.0070.04310.93
5.2.40.0130.04010.96
5.2.30.0130.05311.04
5.2.20.0270.03710.87
5.2.10.0100.05010.79
5.2.00.0030.04710.58
5.1.60.0100.0379.93
5.1.50.0030.0379.99
5.1.40.0070.04010.12
5.1.30.0130.03010.35
5.1.20.0100.03310.47
5.1.10.0130.02710.14
5.1.00.0070.0339.96
5.0.50.0070.0278.48
5.0.40.0030.0278.55
5.0.30.0000.0478.29
5.0.20.0070.0238.26
5.0.10.0070.0238.02
5.0.00.0100.0378.05
4.4.90.0030.0205.91
4.4.80.0030.0205.83
4.4.70.0000.0235.86
4.4.60.0000.0235.88
4.4.50.0070.0175.91
4.4.40.0070.0335.77
4.4.30.0030.0235.76
4.4.20.0030.0305.91
4.4.10.0070.0275.83
4.4.00.0030.0475.82
4.3.110.0070.0205.86
4.3.100.0000.0235.79
4.3.90.0030.0205.67
4.3.80.0000.0375.80
4.3.70.0000.0275.75
4.3.60.0030.0275.69
4.3.50.0030.0305.65
4.3.40.0070.0375.75
4.3.30.0100.0174.51
4.3.20.0000.0234.50
4.3.10.0030.0204.52
4.3.00.0000.0236.86

preferences:
60.3 ms | 401 KiB | 5 Q