3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "°Freen\x18 ew°\x90ɮ\x7F\xc2"; $result="\xC2"; //$result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~S', '', $result); $result = preg_replace('~[\x{0000}-\x{000F}\x{007F}-\x{00a0}]~', '', $result); $string = "°Freen\x18 ew°\x90ɮ\x7F\xc2"; $string = preg_replace("#[\x09\x0A\x0D\x20-\x7E]#" ,"",$string); // ASCII $string = preg_replace("#[\xC2-\xDF][\x80-\xBF]#" ,"",$string); // non-overlong 2-byte $string = preg_replace("#\xE0[\xA0-\xBF][\x80-\xBF]#" ,"",$string); // excluding overlongs $string = preg_replace("#[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}#","",$string); // straight 3-byte $string = preg_replace("#\xED[\x80-\x9F][\x80-\xBF]#" ,"",$string); // excluding surrogates $string = preg_replace("#\xF0[\x90-\xBF][\x80-\xBF]{2}#","",$string); // planes 1-3 $string = preg_replace("#[\xF1-\xF3][\x80-\xBF]{3}#" ,"",$string); // planes 4-15 $string = preg_replace("#\xF4[\x80-\x8F][\x80-\xBF]{2}#","",$string); // plane 16 /* //reject overly long 2 byte sequences, as well as characters above U+10000 and replace with ? $result= preg_replace( '/[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})/S', '', $result ); */ if($result == "\xC2) echo 'fuck'; echo $result;

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)
5.4.150.0030.05718.89
5.4.140.0070.04016.21
5.4.130.0100.07016.35
5.4.120.0100.03716.24
5.4.110.0030.04316.24
5.4.100.0100.04316.21
5.4.90.0030.04016.39
5.4.80.0100.06716.36
5.4.70.0030.06716.22
5.4.60.0030.04716.38
5.4.50.0000.04716.58
5.4.40.0000.05016.28
5.4.30.0070.04016.27
5.4.20.0030.04716.24
5.4.10.0070.05716.34
5.4.00.0000.04015.80
5.3.250.0100.04314.54
5.3.240.0030.06314.54
5.3.230.0000.04314.57
5.3.220.0070.04314.36
5.3.210.0030.04014.51
5.3.200.0130.04714.49
5.3.190.0030.04014.59
5.3.180.0000.07014.48
5.3.170.0030.08014.36
5.3.160.0000.07314.50
5.3.150.0100.04714.36
5.3.140.0070.05714.50
5.3.130.0070.03714.64
5.3.120.0000.07714.34
5.3.110.0100.03314.49
5.3.100.0100.04713.85
5.3.90.0000.04713.94
5.3.80.0000.04313.99
5.3.70.0000.04013.95
5.3.60.0130.07013.98
5.3.50.0070.05013.74
5.3.40.0030.04013.90
5.3.30.0100.05313.73
5.3.20.0100.06713.48
5.3.10.0070.03313.59
5.3.00.0000.04313.62

preferences:
143.01 ms | 1394 KiB | 7 Q