3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = "\xC2°Freen\x18 ew°\x90ɮ\x7F"; //$result="a\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}\p{Z}]~', '?', $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)
8.3.70.0030.01218.43
8.3.60.0120.00617.00
8.3.50.0140.00717.39
8.3.40.0090.00918.92
8.3.30.0030.01218.95
8.3.20.0000.00818.69
8.3.10.0050.00320.79
8.3.00.0080.00019.50
8.2.180.0160.00316.63
8.2.170.0150.00022.96
8.2.160.0090.00619.29
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0050.00319.73
8.2.110.0070.00321.04
8.2.100.0090.00317.97
8.2.90.0030.00719.30
8.2.80.0030.00618.04
8.2.70.0030.00517.71
8.2.60.0090.00017.93
8.2.50.0040.00418.07
8.2.40.0000.00818.16
8.2.30.0060.00318.04
8.2.20.0000.00817.83
8.2.10.0000.00717.96
8.2.00.0080.00017.84
8.1.280.0120.00325.92
8.1.270.0090.00024.66
8.1.260.0060.00326.35
8.1.250.0090.00028.09
8.1.240.0060.00322.64
8.1.230.0070.00320.88
8.1.220.0030.00617.79
8.1.210.0000.00818.95
8.1.200.0070.00317.38
8.1.190.0050.00317.53
8.1.180.0030.00618.10
8.1.170.0000.00818.96
8.1.160.0020.00518.99
8.1.150.0000.00718.79
8.1.140.0000.00717.59
8.1.130.0040.00417.88
8.1.120.0070.00017.64
8.1.110.0000.00817.58
8.1.100.0000.00717.47
8.1.90.0020.00517.62
8.1.80.0000.00817.55
8.1.70.0000.00717.61
8.1.60.0000.00817.67
8.1.50.0080.00017.58
8.1.40.0050.00317.59
8.1.30.0030.00517.70
8.1.20.0050.00317.82
8.1.10.0050.00317.56
8.1.00.0050.00317.59
8.0.300.0030.00619.85
8.0.290.0040.00416.88
8.0.280.0030.00318.48
8.0.270.0000.00717.17
8.0.260.0000.00616.97
8.0.250.0040.00417.03
8.0.240.0080.00317.12
8.0.230.0000.00717.03
8.0.220.0030.00317.01
8.0.210.0070.00017.04
8.0.200.0070.00016.97
8.0.190.0030.00617.04
8.0.180.0040.00416.91
8.0.170.0030.00617.02
8.0.160.0070.00017.03
8.0.150.0050.00516.92
8.0.140.0060.00316.95
8.0.130.0000.00513.46
8.0.120.0050.00216.91
8.0.110.0040.00417.10
8.0.100.0000.00817.00
8.0.90.0000.00816.92
8.0.80.0070.00716.99
8.0.70.0040.00417.07
8.0.60.0040.00417.14
8.0.50.0000.00916.95
8.0.30.0080.01017.00
8.0.20.0060.01217.25
8.0.10.0040.00417.12
8.0.00.0100.00916.91
7.4.330.0000.00513.18
7.4.320.0000.00616.89
7.4.300.0030.00316.80
7.4.290.0000.00716.81
7.4.280.0030.00716.93
7.4.270.0070.00016.80
7.4.260.0030.00313.49
7.4.250.0000.00916.88
7.4.240.0000.00716.77
7.4.230.0030.00616.70
7.4.220.0120.00916.76
7.4.210.0090.00816.88
7.4.200.0030.00316.88
7.4.190.0040.00416.97
7.4.160.0080.00816.63
7.4.150.0180.00016.72
7.4.140.0140.00716.75
7.4.130.0040.01416.70
7.4.120.0070.01016.90
7.4.110.0060.01216.63
7.4.100.0120.00916.70
7.4.90.0110.00716.86
7.4.80.0110.01116.63
7.4.70.0090.01516.57
7.4.60.0070.01016.53
7.4.50.0000.01016.71
7.4.40.0060.00916.86
7.4.30.0160.00016.84
7.4.00.0070.00715.34
7.3.330.0030.00313.26
7.3.320.0000.00513.26
7.3.310.0000.00816.32
7.3.300.0000.00716.39
7.3.290.0160.00016.32
7.3.280.0090.00616.33
7.3.270.0090.00916.41
7.3.260.0110.00816.55
7.3.250.0030.01716.53
7.3.240.0030.01316.40
7.3.230.0100.00616.41
7.3.210.0060.00916.44
7.3.200.0120.01019.39
7.3.190.0160.00416.45
7.3.180.0090.00616.46
7.3.170.0120.00916.57
7.3.160.0040.01116.38
7.3.120.0110.00414.92
7.3.110.0100.00715.12
7.3.100.0090.00614.74
7.3.90.0030.01015.09
7.3.80.0030.00814.77
7.3.70.0110.00414.66
7.3.60.0150.00015.02
7.3.50.0070.00314.84
7.3.40.0070.00314.81
7.3.30.0100.00715.00
7.3.20.0050.00516.83
7.3.10.0120.00516.63
7.3.00.0110.00416.43
7.2.330.0070.01016.64
7.2.320.0090.00916.67
7.2.310.0100.01316.71
7.2.300.0060.01616.84
7.2.290.0100.00716.82
7.2.240.0000.01415.22
7.2.230.0070.01015.23
7.2.220.0080.00415.19
7.2.210.0100.00715.33
7.2.200.0060.00914.89
7.2.190.0080.00415.21
7.2.180.0070.00714.92
7.2.170.0030.01314.89
7.2.160.0030.00715.29
7.2.150.0130.00617.15
7.2.140.0080.01217.00
7.2.130.0040.01016.80
7.2.120.0040.01017.00
7.2.110.0080.00616.92
7.2.100.0130.00516.84
7.2.90.0110.00516.97
7.2.80.0070.00916.99
7.2.70.0090.00716.98
7.2.60.0070.01116.71
7.2.50.0130.00716.94
7.2.40.0080.00716.93
7.2.30.0110.00916.88
7.2.20.0070.00916.91
7.2.10.0080.00917.03
7.2.00.0080.00917.64
7.1.330.0030.01116.09
7.1.320.0030.00715.92
7.1.310.0040.01116.07
7.1.300.0080.00816.11
7.1.290.0100.00715.77
7.1.280.0060.00615.98
7.1.270.0030.01216.01
7.1.260.0070.00315.99
7.1.250.0110.00615.84
7.1.240.0000.00915.84
7.1.230.0030.00716.21
7.1.220.0100.00515.98
7.1.210.0120.00316.03
7.1.200.0110.00015.81
7.1.190.0060.00916.08
7.1.180.0070.00415.87
7.1.170.0070.00316.19
7.1.160.0150.00416.02
7.1.150.0090.00616.14
7.1.140.0030.01315.79
7.1.130.0090.00615.92
7.1.120.0120.00316.13
7.1.110.0100.00616.01
7.1.100.0030.00817.23
7.1.90.0120.00416.00
7.1.80.0130.00715.79
7.1.70.0040.00816.64
7.1.60.0110.01117.70
7.1.50.0120.00816.75
7.1.40.0030.00915.86
7.1.30.0000.01316.13
7.1.20.0040.01215.98
7.1.10.0030.00915.96
7.1.00.0030.03319.21
7.0.330.0040.01115.49
7.0.320.0080.00415.26
7.0.310.0170.00015.53
7.0.300.0090.00515.33
7.0.290.0090.00915.55
7.0.280.0000.01615.51
7.0.270.0060.00915.41
7.0.260.0040.01215.44
7.0.250.0080.00415.64
7.0.240.0070.00615.66
7.0.230.0170.00015.63
7.0.220.0070.00815.51
7.0.210.0080.00815.42
7.0.200.1810.01615.29
7.0.190.0110.01115.52
7.0.180.0060.01015.57
7.0.170.0140.00015.68
7.0.160.0040.00715.52
7.0.150.0040.00415.72
7.0.140.0080.03818.90
7.0.130.0030.01015.55
7.0.120.0020.03218.85
7.0.110.0050.00315.44
7.0.100.0070.00715.77
7.0.90.0030.00715.68
7.0.80.0000.01415.80
7.0.70.0060.00615.27
7.0.60.0070.04217.86
7.0.50.0070.02516.59
7.0.40.0020.02716.81
7.0.30.0340.02616.78
7.0.20.0170.03716.80
7.0.10.0170.04617.04
7.0.00.0050.02916.85
5.6.380.0070.00714.24
5.6.370.0070.00714.00
5.6.360.0030.01014.50
5.6.350.0000.01214.59
5.6.340.0070.00714.59
5.6.330.0070.00714.47
5.6.320.0100.00614.25
5.6.310.0110.00014.50
5.6.300.0000.01614.45
5.6.290.0040.00814.75
5.6.280.0050.04217.54
5.6.270.0060.00314.36
5.6.260.0000.01514.15
5.6.250.0090.00314.48
5.6.240.0040.00814.21
5.6.230.0040.00414.65
5.6.220.0080.00614.23
5.6.210.0060.03517.41
5.6.200.0030.02316.39
5.6.190.0140.01817.34
5.6.180.0130.03717.38
5.6.170.0120.02117.38
5.6.160.0070.02017.42
5.6.150.0000.02916.15
5.6.140.0070.04416.31
5.6.130.0120.02816.12
5.6.120.0060.03617.67
5.6.110.0120.04417.56
5.6.100.0100.04417.61
5.6.90.0080.04517.57
5.6.80.0030.02617.37
5.6.70.0160.04017.22
5.6.60.0090.00614.20
5.6.50.0000.01514.34
5.6.40.0030.01314.51
5.6.30.0030.00614.16
5.6.20.0070.00714.05
5.6.10.0070.00714.26
5.6.00.0100.00714.38
5.5.380.0000.00611.30
5.5.370.0000.00811.40
5.5.360.0040.00710.93
5.5.350.0170.03715.72
5.5.340.0020.04314.55
5.5.330.0080.04315.86
5.5.320.0060.04515.67
5.5.310.0160.02215.71
5.5.300.0060.02614.56
5.5.290.0100.03814.49
5.5.280.0060.04416.06
5.5.270.0020.02716.17
5.5.260.0080.04216.06
5.5.250.0100.04015.81
5.5.240.0020.03115.57
5.5.230.0070.00410.94
5.5.220.0070.00211.02
5.5.210.0060.00311.10
5.5.200.0000.00711.00
5.5.190.0000.01010.95
5.5.180.0030.00610.85
5.5.170.0060.00310.85
5.5.160.0030.00711.07
5.5.150.0000.00611.21
5.5.140.0000.00811.13
5.5.130.0090.00311.11
5.5.120.0120.00010.80
5.5.110.0000.00611.21
5.5.100.0000.00811.18
5.5.90.0060.00311.14
5.5.80.0040.00811.08
5.5.70.0040.00711.09
5.5.60.0030.01011.02
5.5.50.0030.00610.98
5.5.40.0000.00811.07
5.5.30.0030.00910.79
5.5.20.0080.00010.93
5.5.10.0030.00311.13
5.5.00.0070.00310.91
5.4.450.0140.03715.06
5.4.440.0020.05215.15
5.4.430.0030.04315.32
5.4.420.0060.03115.04
5.4.410.0030.03515.17
5.4.400.0040.02915.08
5.4.390.0050.04215.14
5.4.380.0070.03015.05
5.4.370.0080.02514.95
5.4.360.0110.03915.01
5.4.350.0080.02815.08
5.4.340.0050.03914.95
5.4.330.0060.00010.97
5.4.320.0080.03214.95
5.4.310.0110.03815.19
5.4.300.0100.03614.92
5.4.290.0020.02914.96
5.4.280.0050.02315.01
5.4.270.0060.02115.08
5.4.260.0020.02614.87
5.4.250.0070.01915.03
5.4.240.0050.01815.20
5.4.230.0060.02215.03
5.4.220.0040.02214.90
5.4.210.0030.02314.89
5.4.200.0030.02215.07
5.4.190.0050.02215.07
5.4.180.0000.02615.01
5.4.170.0030.02015.04
5.4.160.0120.02314.91
5.4.150.0070.01814.96
5.4.140.0050.02013.74
5.4.130.0030.02013.60
5.4.120.0020.02013.66
5.4.110.0020.02213.70
5.4.100.0000.02413.61
5.4.90.0030.02013.52
5.4.80.0040.02013.63
5.4.70.0060.02013.56
5.4.60.0040.02113.68
5.4.50.0050.02313.62
5.4.40.0080.01813.48
5.4.30.0040.01913.61
5.4.20.0000.02213.75
5.4.10.0060.01813.71
5.4.00.0050.02013.37
5.3.290.0080.02512.64
5.3.280.0080.01712.54
5.3.270.0050.02212.52
5.3.260.0000.02612.58
5.3.250.0030.01812.57
5.3.240.0010.02112.41
5.3.230.0020.02312.52
5.3.220.0070.01812.38
5.3.210.0050.01812.41
5.3.200.0000.02412.40
5.3.190.0090.01712.46
5.3.180.0000.02512.39
5.3.170.0020.02312.48
5.3.160.0030.02012.50
5.3.150.0050.01812.52
5.3.140.0070.02012.44
5.3.130.0030.02212.42
5.3.120.0030.02212.45
5.3.110.0030.02212.49
5.3.100.0010.02612.15
5.3.90.0010.02312.21
5.3.80.0060.01912.06
5.3.70.0020.02312.19
5.3.60.0070.02412.27
5.3.50.0040.01812.07
5.3.40.0020.02512.07
5.3.30.0100.02812.12
5.3.20.0050.02212.03
5.3.10.0030.02811.93
5.3.00.0100.03811.84
5.2.170.0060.02810.67
5.2.160.0050.02310.61
5.2.150.0000.03710.67
5.2.140.0030.01710.63
5.2.130.0030.01910.59
5.2.120.0060.03010.61
5.2.110.0030.03210.75
5.2.100.0020.03110.67
5.2.90.0080.01510.66
5.2.80.0030.03810.67
5.2.70.0050.02710.62
5.2.60.0090.03010.63
5.2.50.0080.02710.63
5.2.40.0020.02810.54
5.2.30.0060.03010.57
5.2.20.0060.02110.65
5.2.10.0050.03010.50
5.2.00.0040.02010.45
5.1.60.0050.02310.08
5.1.50.0050.03010.11
5.1.40.0050.01810.11
5.1.30.0040.03010.30
5.1.20.0020.02710.28
5.1.10.0050.01510.17
5.1.00.0060.03110.19
5.0.50.0020.0159.36
5.0.40.0040.0139.37
5.0.30.0050.0209.22
5.0.20.0040.0229.21
5.0.10.0080.0139.20
5.0.00.0000.0239.19
4.4.90.0020.0229.05
4.4.80.0020.0209.05
4.4.70.0020.0229.05
4.4.60.0000.0159.05
4.4.50.0020.0209.05
4.4.40.0050.0309.05
4.4.30.0010.0209.05
4.4.20.0030.0119.05
4.4.10.0010.0119.05
4.4.00.0020.0169.05
4.3.110.0050.0179.05
4.3.100.0050.0189.05
4.3.90.0000.0159.05
4.3.80.0020.0229.05
4.3.70.0020.0229.05
4.3.60.0030.0209.05
4.3.50.0020.0179.05
4.3.40.0020.0309.05
4.3.30.0020.0209.05
4.3.20.0000.0229.05
4.3.10.0000.0179.05
4.3.00.0000.0229.05

preferences:
52.52 ms | 401 KiB | 5 Q