3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Fuente: https://gist.github.com/gcoop/701814 function cleanse($string) { if (get_magic_quotes_gpc()) { $string = stripslashes($stringIn); } $search = array('&acirc;€“','&acirc;€œ','&acirc;€˜','&acirc;€™','&Acirc;&pound;','&Acirc;&not;','&acirc;„&cent;'); $replace = array('-','&ldquo;','&lsquo;','&rsquo;','&pound;','&not;','&#8482;'); $string = str_replace($search, $replace, $string); $string = str_replace('&acirc;€', '&rdquo;', $string); $search = array("&#39;", "\xc3\xa2\xc2\x80\xc2\x99", "\xc3\xa2\xc2\x80\xc2\x93", "\xc3\xa2\xc2\x80\xc2\x9d", "\xc3\xa2\x3f\x3f"); $resplace = array("'", "'", ' - ', '"', "'"); $string = str_replace($search, $replace, $string); $quotes = array( "\xC2\xAB" => '"', "\xC2\xBB" => '"', "\xE2\x80\x98" => "'", "\xE2\x80\x99" => "'", "\xE2\x80\x9A" => "'", "\xE2\x80\x9B" => "'", "\xE2\x80\x9C" => '"', "\xE2\x80\x9D" => '"', "\xE2\x80\x9E" => '"', "\xE2\x80\x9F" => '"', "\xE2\x80\xB9" => "'", "\xE2\x80\xBA" => "'", "\xe2\x80\x93" => "-", "\xc2\xb0" => "°", "\xc2\xba" => "°", "\xc3\xb1" => "&#241;", "\x96" => "&#241;", "\xe2\x81\x83" => '&bull;', "\xd5" => "'" ); return strtr($string, $quotes); } echo cleanse('“This is a test”');

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.0140.00716.75
8.3.60.0110.01116.63
8.3.50.0100.01018.32
8.3.40.0110.00418.88
8.3.30.0080.00818.50
8.3.20.0000.01518.91
8.3.10.0060.00320.66
8.3.00.0040.00419.38
8.2.180.0070.00718.16
8.2.170.0030.01422.96
8.2.160.0090.00620.35
8.2.150.0000.00924.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0030.01220.29
8.2.110.0060.00321.18
8.2.100.0030.01017.78
8.2.90.0060.00319.34
8.2.80.0030.00519.30
8.2.70.0080.00017.63
8.2.60.0050.00317.80
8.2.50.0080.00018.07
8.2.40.0000.00818.03
8.2.30.0040.00417.99
8.2.20.0070.00319.38
8.2.10.0040.00417.62
8.2.00.0070.00317.71
8.1.280.0100.01025.92
8.1.270.0040.00424.66
8.1.260.0150.00026.35
8.1.250.0070.00028.09
8.1.240.0040.00422.32
8.1.230.0080.00320.97
8.1.220.0040.00417.74
8.1.210.0050.00318.96
8.1.200.0100.00017.36
8.1.190.0000.00717.39
8.1.180.0050.00318.10
8.1.170.0060.00318.84
8.1.160.0070.00018.72
8.1.150.0000.00918.56
8.1.140.0040.00417.36
8.1.130.0030.00317.76
8.1.120.0070.00017.31
8.1.110.0000.00817.39
8.1.100.0000.00817.38
8.1.90.0050.00317.34
8.1.80.0040.00417.38
8.1.70.0030.00317.32
8.1.60.0090.00017.48
8.1.50.0000.00817.41
8.1.40.0040.00417.42
8.1.30.0050.00317.61
8.1.20.0050.00317.61
8.1.10.0000.00817.45
8.1.00.0050.00217.34
8.0.300.0070.00019.90
8.0.290.0040.00416.75
8.0.280.0000.00718.29
8.0.270.0000.00917.16
8.0.260.0000.00716.88
8.0.250.0050.00316.85
8.0.240.0040.00416.99
8.0.230.0070.00016.82
8.0.220.0070.00016.88
8.0.210.0030.00316.88
8.0.200.0030.00616.99
8.0.190.0070.00016.87
8.0.180.0030.00516.94
8.0.170.0030.00616.82
8.0.160.0040.00416.89
8.0.150.0000.00816.79
8.0.140.0000.00716.88
8.0.130.0030.00313.35
8.0.120.0080.00016.73
8.0.110.0000.00716.78
8.0.100.0040.00416.85
8.0.90.0000.00816.79
8.0.80.0100.01016.84
8.0.70.0030.00516.84
8.0.60.0070.00016.95
8.0.50.0050.00316.70
8.0.30.0120.00417.12
8.0.20.0100.01316.93
8.0.10.0040.00417.01
8.0.00.0090.01016.63
7.4.330.0050.00012.93
7.4.320.0000.00616.45
7.4.300.0000.00616.61
7.4.290.0070.00016.43
7.4.280.0000.00916.51
7.4.270.0000.00716.59
7.4.260.0030.00313.31
7.4.250.0050.00216.60
7.4.240.0000.00716.58
7.4.230.0070.00016.30
7.4.220.0140.00716.54
7.4.210.0100.00316.45
7.4.200.0000.00716.25
7.4.190.0030.00316.46
7.4.160.0080.00816.40
7.4.150.0090.00916.58
7.4.140.0070.01016.57
7.4.130.0060.01216.34
7.4.120.0090.00916.64
7.4.110.0120.00616.57
7.4.100.0110.00516.55
7.4.90.0130.01016.44
7.4.80.0120.00516.39
7.4.70.0110.00516.52
7.4.60.0180.00616.55
7.4.50.0040.00416.53
7.4.40.0110.00716.30
7.4.30.0040.01116.48
7.4.00.0060.00614.98
7.3.330.0030.00313.23
7.3.320.0000.00513.09
7.3.310.0000.00716.14
7.3.300.0030.00316.20
7.3.290.0090.00616.25
7.3.280.0060.01116.21
7.3.270.0140.00316.10
7.3.260.0090.00916.45
7.3.250.0080.01116.33
7.3.240.0090.01216.35
7.3.230.0100.00716.29
7.3.210.0070.01016.32
7.3.200.0000.01619.39
7.3.190.0100.01016.35
7.3.180.0150.00616.29
7.3.170.0120.00416.45
7.3.160.0100.00616.57
7.3.120.0100.00714.78
7.2.330.0120.00616.34
7.2.320.0110.01216.29
7.2.310.0120.00616.54
7.2.300.0140.00316.65
7.2.290.0120.00816.26
7.2.00.0060.00919.49
7.1.100.0070.00318.23
7.1.70.0000.01117.12
7.1.60.0000.01419.31
7.1.50.0090.01116.68
7.1.00.0000.03722.27
7.0.200.0150.00314.92
7.0.140.0030.07322.18
7.0.120.0070.07322.16
7.0.60.0100.07321.77
7.0.50.0100.07717.89
7.0.40.0100.08019.98
7.0.30.0330.04020.07
7.0.20.0230.06020.16
7.0.10.0030.07020.33
7.0.00.0070.09020.25
5.6.280.0000.07720.93
5.6.210.0000.08020.53
5.6.200.0100.07318.18
5.6.190.0170.08020.50
5.6.180.0230.04720.55
5.6.170.0230.04720.46
5.6.160.0000.09320.54
5.6.150.0130.08018.16
5.6.140.0070.05018.26
5.6.130.0000.04318.29
5.6.120.0100.08321.14
5.6.110.0130.08021.14
5.6.100.0030.06321.13
5.6.90.0170.08021.09
5.6.80.0130.06720.44
5.5.350.0100.05020.34
5.5.340.0100.07317.96
5.5.330.0070.08320.29
5.5.320.0370.06720.51
5.5.310.0270.07720.19
5.5.300.0000.04018.00
5.5.290.0030.08717.98
5.5.280.0070.06720.99
5.5.270.0100.08020.90
5.5.260.0030.08720.70
5.5.250.0070.08020.57
5.5.240.0270.07020.21
5.4.450.0070.06319.18
5.4.440.0000.08319.38
5.4.430.0100.03319.30
5.4.420.0070.07719.56
5.4.410.0000.04719.12
5.4.400.0000.09019.16
5.4.390.0100.06719.12
5.4.380.0070.08019.08
5.4.370.0070.06319.25
5.4.360.0000.05719.24
5.4.350.0030.05019.00
5.4.340.0100.03319.15
5.4.320.0070.04719.20
5.4.310.0000.07319.20
5.4.300.0070.04318.92
5.4.290.0100.07719.15
5.4.280.0030.05318.92
5.4.270.0170.06719.11
5.4.260.0030.06319.23
5.4.250.0070.07318.91
5.4.240.0030.07019.16
5.4.230.0030.04719.14
5.4.220.0000.07719.13
5.4.210.0170.06319.11
5.4.200.0130.06719.07
5.4.190.0070.04719.14
5.4.180.0030.06719.14
5.4.170.0070.07719.11
5.4.160.0000.05019.22
5.4.150.0070.08019.00
5.4.140.0070.07716.45
5.4.130.0000.05016.34
5.4.120.0000.04016.31
5.4.110.0170.06716.30
5.4.100.0100.05716.39
5.4.90.0100.06716.65
5.4.80.0130.05316.37
5.4.70.0030.07016.32
5.4.60.0070.05016.46
5.4.50.0000.04016.36
5.4.40.0100.03016.27
5.4.30.0070.03716.46
5.4.20.0000.03716.27
5.4.10.0030.03716.45
5.4.00.0000.04315.78
5.3.290.0170.05714.68
5.3.280.0130.04014.50
5.3.270.0130.07314.63
5.3.260.0070.03714.63
5.3.250.0130.06714.62
5.3.240.0030.07014.66
5.3.230.0130.06314.61
5.3.220.0070.05714.72
5.3.210.0130.03714.64
5.3.200.0100.04314.73
5.3.190.0070.07314.64
5.3.180.0130.07014.59
5.3.170.0070.04314.60
5.3.160.0030.04714.73
5.3.150.0070.07314.74
5.3.140.0270.02314.57
5.3.130.0030.03714.57
5.3.120.0070.03714.61
5.3.110.0030.04314.63
5.3.100.0100.03014.10
5.3.90.0130.03714.05
5.3.80.0030.03713.98
5.3.70.0030.03314.05
5.3.60.0030.03314.03
5.3.50.0070.03314.04
5.3.40.0070.03313.96
5.3.30.0070.03013.93
5.3.20.0070.03313.75
5.3.10.0100.02713.62
5.3.00.0000.04013.68
5.2.170.0030.02711.32
5.2.160.0030.02711.32
5.2.150.0000.03011.31
5.2.140.0030.02711.08
5.2.130.0070.03011.12
5.2.120.0030.02711.09
5.2.110.0000.03011.17
5.2.100.0100.02011.12
5.2.90.0000.03011.27
5.2.80.0070.02311.17
5.2.70.0000.03711.11
5.2.60.0000.03711.10
5.2.50.0000.03011.19
5.2.40.0030.03011.06
5.2.30.0000.03311.04
5.2.20.0130.02310.98
5.2.10.0030.02710.92
5.2.00.0000.03010.89
5.1.60.0070.01710.07
5.1.50.0030.02310.07
5.1.40.0000.04310.14
5.1.30.0000.02710.50
5.1.20.0030.02310.36
5.1.10.0030.02310.07
5.1.00.0030.02310.10
5.0.50.0030.0178.52
5.0.40.0000.0238.40
5.0.30.0000.0308.28
5.0.20.0000.0208.19
5.0.10.0000.0208.24
5.0.00.0000.0308.18
4.4.90.0030.0137.75
4.4.80.0000.0177.75
4.4.70.0000.0177.75
4.4.60.0030.0137.75
4.4.50.0030.0137.75
4.4.40.0000.0237.75
4.4.30.0000.0207.75
4.4.20.0030.0137.75
4.4.10.0030.0137.75
4.4.00.0000.0237.75
4.3.110.0000.0177.75
4.3.100.0030.0137.75
4.3.90.0000.0137.75
4.3.80.0030.0237.75
4.3.70.0000.0137.75
4.3.60.0000.0137.75
4.3.50.0000.0137.75
4.3.40.0000.0237.75
4.3.30.0030.0177.75
4.3.20.0030.0277.75
4.3.10.0000.0377.75
4.3.00.0000.0137.75

preferences:
46.94 ms | 401 KiB | 5 Q