3v4l.org

run code in 300+ PHP versions simultaneously
<?php $charset = 'UTF-8'; // PHP Meh. $encoding = 'UTF-8'; header('Content-Type: application/xml; charset=' . $charset); ini_set('default_charset', $charset); mb_internal_encoding('UTF-8'); $rawUtf8Text = '豁ヲ蠢・'; $encodedText = mb_encode_numericentity($rawUtf8Text, [0x0, 0xffff, 0, 0xffff], 'UTF-8'); $clearText = mb_decode_numericentity($encodedText, [0x0, 0xffff, 0, 0xffff], 'UTF-8'); echo "RAW UTF-8 STRING: {$clearText}\nNUMERICALLY ENCODED STRING: {$encodedText}\nROUND TRIP ENCODE/DECODE STRING: {$clearText}\n"; $xml = '<first-name>' . $encodedText . '</first-name>'; echo "ENCODED XML TO BE PARSED:{$xml}\n"; $decodedFromXml = mb_decode_numericentity(strip_tags($encodedText), [0x0, 0xffff, 0, 0xffff], 'UTF-8'); echo "DECODED STRING FROM XML: {$decodedFromXml}\n";

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.120.0040.00420.61
8.3.110.0030.00516.62
8.3.100.0030.00524.06
8.3.90.0040.00426.77
8.3.80.0030.00618.42
8.3.70.0070.00718.27
8.3.60.0140.00718.31
8.3.50.0070.01216.44
8.3.40.0090.01218.79
8.3.30.0030.01018.77
8.3.20.0060.00320.08
8.3.10.0080.00020.73
8.3.00.0080.00019.23
8.2.240.0030.00617.16
8.2.230.0050.00520.94
8.2.220.0080.00037.54
8.2.210.0050.00326.77
8.2.200.0080.00018.54
8.2.190.0110.00418.41
8.2.180.0000.01616.32
8.2.170.0040.01122.96
8.2.160.0100.00320.20
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00421.04
8.2.120.0050.00326.35
8.2.110.0030.00620.97
8.2.100.0130.00019.45
8.2.90.0040.00417.97
8.2.80.0000.00818.21
8.2.70.0000.00817.63
8.2.60.0040.00418.04
8.2.50.0040.00418.07
8.2.40.0040.00418.03
8.2.30.0030.00618.09
8.2.20.0050.00218.00
8.2.10.0040.00418.18
8.2.00.0000.00718.22
8.1.300.0060.00320.37
8.1.290.0090.00030.84
8.1.280.0110.01125.92
8.1.270.0030.00623.84
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00322.04
8.1.230.0090.00320.93
8.1.220.0000.00917.74
8.1.210.0000.00819.09
8.1.200.0030.00517.35
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0000.01018.26
8.1.160.0030.00619.04
8.1.150.0000.00718.96
8.1.140.0000.00719.57
8.1.130.0000.00718.90
8.1.120.0050.00317.51
8.1.110.0000.00817.55
8.1.100.0000.00917.55
8.1.90.0000.00817.42
8.1.80.0000.00717.51
8.1.70.0040.00417.41
8.1.60.0030.00517.53
8.1.50.0040.00417.55
8.1.40.0030.00617.44
8.1.30.0040.00417.73
8.1.20.0040.00417.71
8.1.10.0040.00417.59
8.1.00.0040.00417.39
8.0.300.0000.00720.11
8.0.290.0070.00016.88
8.0.280.0000.00718.52
8.0.270.0000.00717.32
8.0.260.0060.00018.95
8.0.250.0000.00816.95
8.0.240.0040.00416.91
8.0.230.0030.00317.06
8.0.220.0000.00716.92
8.0.210.0000.00716.82
8.0.200.0000.00716.92
8.0.190.0000.00716.99
8.0.180.0070.00016.88
8.0.170.0000.00817.00
8.0.160.0000.00816.82
8.0.150.0000.00716.85
8.0.140.0040.00416.96
8.0.130.0030.00313.37
8.0.120.0000.00716.91
8.0.110.0040.00416.93
8.0.100.0080.00016.73
8.0.90.0000.00717.00
8.0.80.0150.00016.93
8.0.70.0040.00416.76
8.0.60.0070.00016.99
8.0.50.0040.00416.87
8.0.30.0100.00817.01
8.0.20.0100.00817.40
8.0.10.0000.00716.95
8.0.00.0030.01516.62
7.4.330.0020.00215.55
7.4.320.0000.00616.61
7.4.300.0000.00616.49
7.4.290.0040.00416.57
7.4.280.0080.00016.45
7.4.270.0030.00516.58
7.4.260.0040.00416.42
7.4.250.0040.00416.48
7.4.240.0050.00316.50
7.4.230.0040.00416.44
7.4.220.0060.01316.53
7.4.210.0090.00616.45
7.4.200.0000.00716.36
7.4.160.0100.00616.46
7.4.150.0090.00917.40
7.4.140.0050.01317.86
7.4.130.0070.01416.61
7.4.120.0090.01516.46
7.4.110.0030.01316.59
7.4.100.0160.00416.48
7.4.90.0070.01116.20
7.4.80.0130.00319.39
7.4.70.0090.00616.61
7.4.60.0150.00016.59
7.4.50.0090.00616.56
7.4.40.0080.00816.55
7.4.30.0030.01416.30
7.4.00.0080.01014.97
7.3.330.0050.00013.23
7.3.320.0050.00013.26
7.3.310.0050.00216.39
7.3.300.0000.00716.38
7.3.290.0100.00816.40
7.3.280.0070.00916.40
7.3.270.0130.00317.40
7.3.260.0170.00516.43
7.3.250.0080.01016.42
7.3.240.0080.00816.46
7.3.230.0080.00816.68
7.3.210.0030.01316.27
7.3.200.0120.00416.43
7.3.190.0070.01016.62
7.3.180.0030.01616.61
7.3.170.0170.00016.39
7.3.160.0090.00616.31
7.3.120.0060.01314.80
7.3.110.0080.00914.94
7.3.100.0090.00814.73
7.3.90.0080.00714.90
7.3.80.0060.00714.84
7.3.70.0030.00714.79
7.3.60.0040.00814.82
7.3.50.0080.00914.90
7.3.40.0070.00514.68
7.3.30.0050.00714.76
7.3.20.0080.00616.73
7.3.10.0080.00716.63
7.3.00.0070.00616.50
7.2.330.0100.01416.82
7.2.320.0160.01016.89
7.2.310.0040.01216.78
7.2.300.0070.01016.76
7.2.290.0080.00816.54
7.2.250.0060.01215.17
7.2.240.0060.01215.07
7.2.230.0070.00915.13
7.2.220.0100.00615.16
7.2.210.0080.00615.13
7.2.200.0100.00614.94
7.2.190.0060.00715.03
7.2.180.0040.01214.91
7.2.170.0040.01215.04
7.2.130.0090.00616.79
7.2.120.0090.00816.81
7.2.110.0080.00716.56
7.2.100.0080.00616.58
7.2.90.0090.00616.67
7.2.80.0090.00616.52
7.2.70.0050.01016.76
7.2.60.0060.00816.84
7.2.50.0050.01016.74
7.2.40.0080.00816.87
7.2.30.0080.00716.95
7.2.20.0090.00516.90
7.2.10.0070.00716.64
7.2.00.0100.00616.90
7.1.330.0080.00615.82
7.1.320.0030.01115.80
7.1.310.0060.00815.73
7.1.300.0040.00915.66
7.1.290.0050.00815.92
7.1.280.0060.00815.77
7.1.270.0000.01415.76
7.1.260.0040.00815.82
7.1.250.0060.00715.55
7.1.240.0030.00915.67
7.1.230.0120.00315.93
7.1.220.0070.00715.98
7.1.210.0070.00715.71
7.1.200.0070.00415.89
7.1.190.0040.01115.80
7.1.180.0070.00715.98
7.1.170.0040.00815.84
7.1.160.0000.01215.93
7.1.150.0030.00515.54
7.1.140.0120.00315.88
7.1.130.0040.00715.86
7.1.120.0100.00315.93
7.1.110.0030.01015.89
7.1.100.0080.00015.60
7.1.90.0000.01315.94
7.1.80.0040.00917.00
7.1.70.0060.00616.65
7.1.60.0070.01025.48
7.1.50.0110.00625.41
7.1.40.0090.00925.10
7.1.30.0110.01025.19
7.1.20.0080.01125.18
7.1.10.0030.00916.04
7.1.00.0020.01216.14
7.0.320.0000.00815.04
7.0.310.0030.01215.27
7.0.300.0070.00315.18
7.0.290.0060.00615.33
7.0.280.0030.01015.44
7.0.270.0110.00015.55
7.0.260.0000.00815.51
7.0.250.0100.00315.51
7.0.240.0060.00915.53
7.0.230.0000.01215.50
7.0.220.0040.00415.58
7.0.210.0090.00615.53
7.0.200.0020.00816.14
7.0.190.0050.00615.90
7.0.180.0080.00515.91
7.0.170.0100.00315.73
7.0.160.0000.01315.87
7.0.150.0040.00915.88
7.0.140.0060.00615.73
7.0.130.0040.00915.99
7.0.120.0030.00716.03
7.0.110.0070.00715.75
7.0.100.0030.00915.97
7.0.90.0090.00415.91
7.0.80.0050.00915.72
7.0.70.0040.00715.83
7.0.60.0060.00815.81
7.0.50.0070.00615.87
7.0.40.0070.00515.02
7.0.30.0050.00715.12
7.0.20.0040.00715.08
7.0.10.0040.00515.01
7.0.00.0050.00714.98
5.6.380.0030.00913.90

preferences:
33.2 ms | 403 KiB | 5 Q