3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "°Freen\x18 ew°\x90ɮ\xc2"; //$result = trim($result,"\xc2"/*"\xa0"*/); //echo preg_replace('#[\x00-\x1F\x7F-\x9F]#S', '', $result); $result preg_replace('~[\x{0000}-\x{001F}\x{007F}-\x{00a0}]~', '', $result); //reject overly long 2 byte sequences, as well as characters above U+10000 and replace with ? $result= preg_replace('/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]'. '|[\x00-\x7F][\x80-\xBF]+'. '|([\xC0\xC1]|[\xF0-\xFF])[\x80-\xBF]*'. '|[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})'. '|[\xE0-\xEF](([\x80-\xBF](?![\x80-\xBF]))|(?![\x80-\xBF]{2})|[\x80-\xBF]{3,})/S', '', $result ); 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.140.0130.04312.04
5.4.130.0140.04412.03
5.4.120.0140.04211.99
5.4.110.0150.04311.98
5.4.100.0130.04411.98
5.4.90.0140.04311.98
5.4.80.0130.04311.99
5.4.70.0120.04511.98
5.4.60.0120.04311.98
5.4.50.0150.04211.98
5.4.40.0190.05311.97
5.4.30.0150.04211.96
5.4.20.0200.03611.96
5.4.10.0180.03811.96
5.4.00.0140.04211.46
5.3.240.0130.04712.72
5.3.230.0120.04912.71
5.3.220.0250.06512.68
5.3.210.0190.04212.68
5.3.200.0160.04512.68
5.3.190.0160.04412.68
5.3.180.0190.03912.67
5.3.170.0170.04112.67
5.3.160.0210.06812.67
5.3.150.0160.04212.67
5.3.140.0210.05312.66
5.3.130.0130.04712.66
5.3.120.0230.05012.66
5.3.110.0160.04312.66
5.3.100.0150.04312.12
5.3.90.0190.07012.08
5.3.80.0150.04312.08
5.3.70.0150.04512.07
5.3.60.0110.04812.06
5.3.50.0260.06212.00
5.3.40.0190.03912.00
5.3.30.0160.04011.94
5.3.20.0150.04111.72
5.3.10.0140.04211.68
5.3.00.0210.06711.66

preferences:
133.92 ms | 1398 KiB | 7 Q