3v4l.org

run code in 300+ PHP versions simultaneously
<?php $crap = "\u200e\u206a\u200f\u200e\u202d\u206f\u200c\u206a\u202c\u202b\u200f\u206f\u202b\u206e\u206e\u202b\u206e\u202e\u206c\u202b\u206d\u200e\u202a\u206d\u200b\u206c\u206a\u202e\u206b\u200b\u200f\u200b\u202d\u202d\u206f\u206b\u200c\u206a\u206f\u206b\u202e"; function charset_decode_utf_8 ($string) { /* Only do the slow convert if there are 8-bit characters */ /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */ if (!preg_match("/[\200-\237]/", $string) && !preg_match("/[\241-\377]/", $string) ) { return $string; } // decode three byte unicode characters $string = preg_replace("/([\340-\357])([\200-\277])([\200-\277])/e", "'&#'.((ord('\\1')-224)*4096 + (ord('\\2')-128)*64 + (ord('\\3')-128)).';'", $string ); // decode two byte unicode characters $string = preg_replace("/([\300-\337])([\200-\277])/e", "'&#'.((ord('\\1')-192)*64+(ord('\\2')-128)).';'", $string ); return $string; } $str = charset_decode_utf_8($crap); echo $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)
8.3.60.0130.01018.68
8.3.50.0140.00316.55
8.3.40.0090.00618.96
8.3.30.0070.00718.82
8.3.20.0080.00020.30
8.3.10.0030.00623.67
8.3.00.0060.00319.38
8.2.180.0060.01316.74
8.2.170.0070.00722.96
8.2.160.0120.00320.52
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0040.00422.38
8.2.120.0050.00326.35
8.2.110.0060.00322.21
8.2.100.0120.00017.91
8.2.90.0030.00618.03
8.2.80.0030.00517.97
8.2.70.0050.00317.62
8.2.60.0030.00618.03
8.2.50.0000.00918.16
8.2.40.0040.00422.29
8.2.30.0050.00319.29
8.2.20.0050.00217.98
8.2.10.0080.00018.12
8.2.00.0040.00418.27
8.1.280.0000.01525.92
8.1.270.0040.00422.06
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0090.00023.82
8.1.230.0080.00322.62
8.1.220.0000.00817.74
8.1.210.0070.00318.77
8.1.200.0080.00017.47
8.1.190.0050.00517.48
8.1.180.0040.00418.10
8.1.170.0080.00018.61
8.1.160.0080.00018.86
8.1.150.0070.00018.95
8.1.140.0000.00817.70
8.1.130.0080.00320.68
8.1.120.0040.00417.62
8.1.110.0050.00417.56
8.1.100.0000.00917.53
8.1.90.0000.00817.60
8.1.80.0040.00717.62
8.1.70.0080.00017.60
8.1.60.0050.00317.78
8.1.50.0030.00617.55
8.1.40.0040.00417.56
8.1.30.0050.00317.73
8.1.20.0080.00017.65
8.1.10.0040.00417.62
8.1.00.0080.00017.50
8.0.300.0080.00020.12
8.0.290.0050.00316.75
8.0.280.0050.00318.33
8.0.270.0000.00817.14
8.0.260.0040.00418.93
8.0.250.0000.00717.12
8.0.240.0000.00716.98
8.0.230.0000.00817.07
8.0.220.0030.00317.07
8.0.210.0030.00317.00
8.0.200.0030.00317.10
8.0.190.0080.00016.97
8.0.180.0030.00716.94
8.0.170.0040.00416.98
8.0.160.0070.00017.08
8.0.150.0000.00717.07
8.0.140.0050.00217.05
8.0.130.0030.00313.50
8.0.120.0030.00516.97
8.0.110.0040.00416.90
8.0.100.0040.00416.86
8.0.90.0040.00416.95
8.0.80.0030.01316.98
8.0.70.0050.00317.02
8.0.60.0050.00316.95
8.0.50.0000.00816.98
8.0.30.0090.01417.19
8.0.20.0090.01017.40
8.0.10.0000.00717.02
8.0.00.0130.00516.84
7.4.330.0000.00515.55
7.4.320.0070.00016.73
7.4.300.0030.00316.72
7.4.290.0040.00416.70
7.4.280.0030.00616.71
7.4.270.0030.00316.83
7.4.260.0000.00716.70
7.4.250.0050.00216.78
7.4.240.0080.00016.70
7.4.230.0030.00416.88
7.4.220.0030.00316.59
7.4.210.0130.00616.89
7.4.200.0030.00316.81
7.4.160.0050.01216.79
7.4.150.0100.00917.40
7.4.140.0100.00817.86
7.4.130.0120.00416.69
7.4.120.0120.00716.72
7.4.110.0000.02216.61
7.4.100.0090.00916.76
7.4.90.0090.00916.77
7.4.80.0120.00819.39
7.4.70.0040.01416.69
7.4.60.0090.00616.59
7.4.50.0040.01216.84
7.4.40.0060.00916.76
7.4.10.0040.01116.57
7.4.00.0040.01215.39
7.3.330.0030.00313.46
7.3.320.0030.00313.38
7.3.310.0000.00716.46
7.3.300.0040.00416.42
7.3.290.0060.00816.48
7.3.280.0060.00916.46
7.3.270.0140.00317.40
7.3.260.0090.01016.73
7.3.250.0130.00616.52
7.3.240.0120.00916.51
7.3.230.0170.00316.76
7.3.210.0000.01716.66
7.3.200.0140.00616.53
7.3.190.0070.00916.40
7.3.180.0140.00316.25
7.3.170.0090.01216.75
7.3.160.0100.00616.72
7.3.130.0130.00316.48
7.3.120.0080.00915.42
7.3.110.0080.00915.37
7.3.100.0050.01015.46
7.3.90.0030.01215.38
7.3.80.0020.01315.34
7.3.70.0030.01115.33
7.3.60.0070.00615.34
7.3.50.0050.01015.24
7.3.40.0050.00915.37
7.3.30.0020.00815.38
7.3.20.0050.00817.09
7.3.10.0080.00517.14
7.3.00.0070.00717.17
7.2.330.0100.00716.85
7.2.320.0070.01016.66
7.2.310.0000.01716.55
7.2.300.0060.00916.72
7.2.290.0060.01016.82
7.2.260.0000.01416.70
7.2.250.0060.01115.70
7.2.240.0080.00915.52
7.2.230.0030.01015.56
7.2.220.0070.00815.67
7.2.210.0060.00615.48
7.2.200.0050.01015.54
7.2.190.0030.01015.37
7.2.180.0070.01015.63
7.2.170.0050.00715.60
7.2.160.0080.00615.72
7.2.150.0030.00917.78
7.2.140.0050.01017.67
7.2.130.0050.00817.67
7.2.120.0080.00517.74
7.2.110.0070.00717.92
7.2.100.0050.00817.80
7.2.90.0070.01017.71
7.2.80.0060.01217.64
7.2.70.0020.01117.81
7.2.60.0050.01017.46
7.2.50.0050.00817.82
7.2.40.0060.01117.86
7.2.30.0030.01217.82
7.2.20.0050.01017.70
7.2.10.0110.01217.98
7.2.00.0120.00717.96
7.1.330.0070.00816.50
7.1.320.0060.00516.24
7.1.310.0070.00716.26
7.1.300.0060.00616.27
7.1.290.0040.00916.32
7.1.280.0060.00716.38
7.1.270.0080.00516.23
7.1.260.0070.00816.37
7.1.250.0050.00716.58
7.1.240.0100.00317.42
7.1.230.0110.00417.48
7.1.220.0000.01217.43
7.1.210.0090.00617.50
7.1.200.0060.00916.76
7.1.190.0070.01117.47
7.1.180.0030.01017.59
7.1.170.0040.01117.60
7.1.160.0130.00017.54
7.1.150.0070.00717.46
7.1.140.0050.00517.50
7.1.130.0130.01117.36
7.1.120.0110.00617.09
7.1.110.0120.00816.94
7.1.100.0140.01216.80
7.1.90.0110.00816.99
7.1.80.0070.01216.99
7.1.70.0110.00816.58
7.1.60.0130.02125.37
7.1.50.0190.00825.41
7.1.40.0140.01225.35
7.1.30.0210.01125.26
7.1.20.0230.01025.13
7.1.10.0180.00816.23
7.1.00.0120.01116.26
7.0.330.0110.00317.23
7.0.320.0040.01117.21
7.0.310.0030.00917.14
7.0.300.0090.00317.12
7.0.290.0080.00417.06
7.0.280.0100.00316.97
7.0.270.0030.01017.13
7.0.260.0000.01217.13
7.0.250.0030.00717.23
7.0.240.0080.00817.36
7.0.230.0060.00916.88
7.0.220.0030.00717.00
7.0.210.0120.00017.17
7.0.200.0000.00917.07
7.0.190.0060.00317.07
7.0.180.0030.01416.99
7.0.170.0100.00317.15
7.0.160.0070.00717.14
7.0.150.0080.00417.02
7.0.140.0060.00616.97
7.0.130.0030.00917.09
7.0.120.0060.00917.25
7.0.110.0100.00717.21
7.0.100.0040.00717.14
7.0.90.0000.01517.16
7.0.80.0080.00417.27
7.0.70.0080.00417.29
7.0.60.0070.00317.21
7.0.50.0110.00617.07
7.0.40.0080.00414.90
7.0.30.0030.01015.15
7.0.20.0080.00315.00
7.0.10.0030.00815.11
7.0.00.0060.00615.12
5.6.400.0000.01515.82
5.6.390.0110.00015.93
5.6.380.0060.00615.54
5.6.370.0060.00316.23
5.6.360.0120.00016.12
5.6.350.0000.01315.78
5.6.340.0090.00616.05
5.6.330.0030.01015.57
5.6.320.0030.00716.17
5.6.310.0080.00415.96
5.6.300.0070.00715.92
5.6.290.0030.00616.25
5.6.280.0070.01115.66
5.6.270.0030.00715.68
5.6.260.0030.00615.59
5.6.250.0070.00416.02
5.6.240.0070.01015.92
5.6.230.0040.00815.82
5.6.220.0100.00715.85
5.6.210.0030.01015.75
5.6.200.0070.01015.78
5.6.190.0040.00815.89
5.6.180.0060.00315.95
5.6.170.0060.00615.69
5.6.160.0060.00915.88
5.6.150.0070.00315.71
5.6.140.0040.01115.75
5.6.130.0070.00716.06
5.6.120.0130.00015.96
5.6.110.0060.00615.91
5.6.100.0040.01215.62
5.6.90.0030.01315.89
5.6.80.0070.00316.04
5.6.70.0060.00515.69
5.6.60.0040.00815.80
5.6.50.0060.01015.73
5.6.40.0040.01115.98
5.6.30.0060.00815.86
5.6.20.0060.00915.73
5.6.10.0060.00616.08
5.6.00.0000.00915.88

preferences:
31.74 ms | 400 KiB | 5 Q