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}\xc2]~i', '?', $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.60.0070.01118.56
8.3.50.0160.01122.08
8.3.40.0070.01118.79
8.3.30.0120.00318.95
8.3.20.0070.00020.32
8.3.10.0090.00023.53
8.3.00.0000.00822.46
8.2.180.0070.01116.74
8.2.170.0140.00322.96
8.2.160.0100.00322.38
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0080.00019.73
8.2.110.0060.00322.28
8.2.100.0060.00617.91
8.2.90.0030.00619.05
8.2.80.0050.00318.04
8.2.70.0030.00917.75
8.2.60.0080.00017.93
8.2.50.0000.00818.07
8.2.40.0050.00318.09
8.2.30.0040.00417.97
8.2.20.0000.00817.74
8.2.10.0040.00417.92
8.2.00.0040.00417.84
8.1.280.0120.00325.92
8.1.270.0080.00023.84
8.1.260.0080.00026.35
8.1.250.0050.00528.09
8.1.240.0060.00323.77
8.1.230.0000.01218.89
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0070.00417.50
8.1.190.0040.00417.39
8.1.180.0040.00418.10
8.1.170.0080.00018.78
8.1.160.0000.00722.02
8.1.150.0000.00818.74
8.1.140.0040.00417.53
8.1.130.0070.00017.78
8.1.120.0040.00417.66
8.1.110.0090.00017.62
8.1.100.0030.00317.63
8.1.90.0000.00717.63
8.1.80.0000.00717.59
8.1.70.0000.00717.63
8.1.60.0080.00017.72
8.1.50.0030.00617.53
8.1.40.0040.00417.69
8.1.30.0060.00317.76
8.1.20.0000.00817.84
8.1.10.0080.00017.64
8.1.00.0050.00317.68
8.0.300.0000.00818.77
8.0.290.0000.00717.16
8.0.280.0070.00018.43
8.0.270.0030.00317.20
8.0.260.0030.00617.02
8.0.250.0000.00717.16
8.0.240.0000.00717.12
8.0.230.0020.00517.09
8.0.220.0000.00716.93
8.0.210.0030.00317.00
8.0.200.0070.00017.06
8.0.190.0040.00417.05
8.0.180.0070.00316.92
8.0.170.0030.00517.02
8.0.160.0000.00716.87
8.0.150.0000.00816.91
8.0.140.0000.00716.92
8.0.130.0000.00613.46
8.0.120.0050.00316.94
8.0.110.0000.00716.95
8.0.100.0000.00717.05
8.0.90.0050.00316.84
8.0.80.0090.01316.98
8.0.70.0000.00717.04
8.0.60.0020.00517.00
8.0.50.0050.00316.86
8.0.30.0070.01217.29
8.0.20.0120.00717.45
8.0.10.0080.00017.20
8.0.00.0120.00816.82
7.4.330.0050.00015.21
7.4.320.0040.00416.83
7.4.300.0000.00616.73
7.4.290.0000.00716.82
7.4.280.0070.00016.79
7.4.270.0070.00016.81
7.4.260.0030.00416.74
7.4.250.0030.00316.79
7.4.240.0040.00416.73
7.4.230.0040.00416.61
7.4.220.0140.00316.71
7.4.210.0100.00516.80
7.4.200.0040.00416.85
7.4.190.0000.00716.88
7.4.160.0140.00316.89
7.4.150.0140.00417.40
7.4.140.0150.00617.86
7.4.130.0120.00816.70
7.4.120.0100.00916.74
7.4.110.0090.00916.72
7.4.100.0100.01316.69
7.4.90.0180.00616.98
7.4.80.0070.01116.76
7.4.70.0060.01116.92
7.4.60.0170.00016.53
7.4.50.0000.00716.48
7.4.40.0040.01222.77
7.4.30.0080.00816.78
7.4.00.0070.01115.17
7.3.330.0030.00313.27
7.3.320.0030.00313.33
7.3.310.0070.00016.21
7.3.300.0000.00716.26
7.3.290.0060.01716.30
7.3.280.0090.01316.31
7.3.270.0120.00617.40
7.3.260.0220.00016.40
7.3.250.0120.01016.56
7.3.240.0080.01116.68
7.3.230.0120.00616.39
7.3.210.0150.00916.65
7.3.200.0070.01119.39
7.3.190.0100.01116.76
7.3.180.0060.01516.71
7.3.170.0080.00816.67
7.3.160.0110.00816.44
7.3.120.0070.01114.98
7.3.110.0070.01114.70
7.3.100.0030.01614.94
7.3.90.0090.00614.64
7.3.80.0040.00815.02
7.3.70.0060.00614.82
7.3.60.0130.00314.96
7.3.50.0060.00614.96
7.3.40.0070.00714.97
7.3.30.0060.01214.69
7.3.20.0040.01116.77
7.3.10.0080.00716.50
7.3.00.0100.00516.70
7.2.330.0100.01016.60
7.2.320.0070.01616.77
7.2.310.0070.01116.68
7.2.300.0120.00616.86
7.2.290.0100.01316.71
7.2.250.0120.00314.90
7.2.240.0070.01015.17
7.2.230.0060.01215.05
7.2.220.0040.00815.18
7.2.210.0030.01315.24
7.2.200.0000.01315.18
7.2.190.0060.01015.09
7.2.180.0040.01515.02
7.2.170.0070.01015.03
7.2.160.0060.01014.87
7.2.150.0000.01117.03
7.2.140.0150.00017.04
7.2.130.0110.00316.83
7.2.120.0150.00316.78
7.2.110.0110.00616.87
7.2.100.0110.00716.75
7.2.90.0080.01216.88
7.2.80.0080.00916.89
7.2.70.0090.00716.93
7.2.60.0090.00716.72
7.2.50.0050.01016.88
7.2.40.0120.00516.81
7.2.30.0130.00316.73
7.2.20.0060.01016.87
7.2.10.0070.00917.00
7.2.00.0050.01017.64
7.1.330.0100.00716.01
7.1.320.0080.00416.05
7.1.310.0030.01216.09
7.1.300.0100.00316.09
7.1.290.0000.01716.03
7.1.280.0110.00015.69
7.1.270.0000.01416.04
7.1.260.0040.01115.71
7.1.250.0110.00415.83
7.1.240.0060.00616.09
7.1.230.0090.00315.91
7.1.220.0070.00716.16
7.1.210.0090.00616.04
7.1.200.0040.00815.89
7.1.190.0030.00916.07
7.1.180.0040.00416.15
7.1.170.0030.01016.12
7.1.160.0000.01115.93
7.1.150.0060.00316.13
7.1.140.0100.00315.80
7.1.130.0050.00516.14
7.1.120.0000.01216.11
7.1.110.0120.00316.03
7.1.100.0090.00517.23
7.1.90.0110.00315.93
7.1.80.0030.00915.95
7.1.70.0020.01216.60
7.1.60.0070.01017.63
7.1.50.0040.00916.52
7.1.40.0040.01115.95
7.1.30.0060.00316.00
7.1.20.0000.00815.93
7.1.10.0040.01216.01
7.1.00.0110.03319.28
7.0.330.0060.00615.38
7.0.320.0070.00715.66
7.0.310.0040.00415.73
7.0.300.0030.00515.48
7.0.290.0040.00815.76
7.0.280.0030.00915.68
7.0.270.0090.00015.41
7.0.260.0060.00615.66
7.0.250.0000.01215.69
7.0.240.0030.00915.78
7.0.230.0040.00815.68
7.0.220.0000.01315.55
7.0.210.0090.00015.36
7.0.200.0050.01016.26
7.0.190.0040.01215.59
7.0.180.0060.00615.64
7.0.170.0070.01015.70
7.0.160.0040.00415.60
7.0.150.0080.00815.39
7.0.140.0030.04018.81
7.0.130.0040.00815.33
7.0.120.0100.00315.74
7.0.110.0030.00915.75
7.0.100.0050.04517.73
7.0.90.0080.04217.83
7.0.80.0030.04617.65
7.0.70.0070.04217.76
7.0.60.0070.04717.79
7.0.50.0100.04017.98
7.0.40.0100.04116.86
7.0.30.0080.03816.89
7.0.20.0080.04216.90
7.0.10.0070.02816.89
7.0.00.0090.04516.85
5.6.400.0070.00714.30
5.6.390.0040.01114.78
5.6.380.0040.00814.32
5.6.370.0030.00714.51
5.6.360.0000.01414.21
5.6.350.0030.00814.28
5.6.340.0000.01414.33
5.6.330.0000.00914.70
5.6.320.0000.01314.42
5.6.310.0040.00714.41
5.6.300.0000.01314.55
5.6.290.0090.00614.32
5.6.280.0030.04217.75
5.6.270.0030.00914.57
5.6.260.0110.00314.50
5.6.250.0080.03817.41
5.6.240.0080.04617.48
5.6.230.0070.03017.41
5.6.220.0100.04117.41
5.6.210.0020.04817.48
5.6.200.0020.03717.68
5.6.190.0030.05017.66
5.6.180.0120.02817.60
5.6.170.0070.04317.67
5.6.160.0140.03717.63
5.6.150.0030.04917.59
5.6.140.0120.02917.60
5.6.130.0100.03717.61
5.6.120.0050.05017.68
5.6.110.0050.04417.68
5.6.100.0090.04017.55
5.6.90.0050.03017.68
5.6.80.0050.04217.36
5.6.70.0080.04217.36
5.6.60.0060.03117.30
5.6.50.0060.02617.17
5.6.40.0080.04517.20
5.6.30.0120.02517.53
5.6.20.0100.03317.43
5.6.10.0080.04117.26
5.6.00.0130.03517.28
5.5.380.0050.04717.27
5.5.370.0080.02817.28
5.5.360.0070.04717.38
5.5.350.0070.04517.36
5.5.340.0060.04517.32
5.5.330.0100.02617.57
5.5.320.0020.04717.33
5.5.310.0100.04217.58
5.5.300.0050.04417.46
5.5.290.0080.04017.51
5.5.280.0070.04417.56
5.5.270.0050.04817.52
5.5.260.0090.04317.62
5.5.250.0080.03917.22
5.5.240.0140.03117.33
5.5.230.0050.04317.19
5.5.220.0080.02817.31
5.5.210.0060.04817.23
5.5.200.0100.04217.23
5.5.190.0050.04217.27
5.5.180.0090.03017.11
5.5.170.0030.01014.39
5.5.160.0070.04517.22
5.5.150.0070.03617.12
5.5.140.0100.03917.31
5.5.130.0020.04917.22
5.5.120.0060.03317.12
5.5.110.0050.02817.00
5.5.100.0030.03717.25
5.5.90.0080.02017.16
5.5.80.0030.02517.24
5.5.70.0050.02317.10
5.5.60.0050.02317.15
5.5.50.0030.03517.25
5.5.40.0030.02517.05
5.5.30.0070.02017.21
5.5.20.0050.04016.95
5.5.10.0050.02417.06
5.5.00.0030.03017.22
5.4.450.0030.04415.18
5.4.440.0030.04415.29
5.4.430.0050.03515.20
5.4.420.0110.02315.07
5.4.410.0040.04015.23
5.4.400.0080.04314.81
5.4.390.0060.04114.92
5.4.380.0020.03914.94
5.4.370.0080.03815.04
5.4.360.0040.04415.15
5.4.350.0050.04015.08
5.4.340.0100.03715.07
5.4.330.0070.00411.07
5.4.320.0070.04015.03
5.4.310.0040.04614.98
5.4.300.0070.03714.92
5.4.290.0030.04015.04
5.4.280.0060.03615.13
5.4.270.0060.02615.03
5.4.260.0050.02514.98
5.4.250.0080.03514.97
5.4.240.0000.02714.92
5.4.230.0070.02214.97
5.4.220.0030.02214.95
5.4.210.0070.02215.01
5.4.200.0030.02514.98
5.4.190.0020.02314.91
5.4.180.0030.02214.97
5.4.170.0080.01715.01
5.4.160.0030.03915.18
5.4.150.0070.01914.96
5.4.140.0060.02613.66
5.4.130.0050.02713.66
5.4.120.0050.02013.64
5.4.110.0030.02213.69
5.4.100.0030.02013.67
5.4.90.0050.02113.68
5.4.80.0010.02413.63
5.4.70.0090.01613.61
5.4.60.0020.02013.63
5.4.50.0020.02613.62
5.4.40.0020.03513.61
5.4.30.0020.02413.66
5.4.20.0050.03513.71
5.4.10.0000.02313.52
5.4.00.0030.02213.35
5.3.290.0110.03312.59
5.3.280.0100.02012.56
5.3.270.0040.03712.57
5.3.260.0100.04012.57
5.3.250.0050.03712.50
5.3.240.0050.03412.57
5.3.230.0100.03012.58
5.3.220.0090.03112.55
5.3.210.0050.03712.56
5.3.200.0080.02912.51
5.3.190.0070.02312.55
5.3.180.0080.02012.55
5.3.170.0040.02512.49
5.3.160.0060.02412.56
5.3.150.0070.03012.50
5.3.140.0080.02212.48
5.3.130.0050.02312.52
5.3.120.0060.03012.54
5.3.110.0070.02112.54
5.3.100.0030.03812.29
5.3.90.0050.03712.21
5.3.80.0080.01812.28
5.3.70.0080.02312.28
5.3.60.0040.02412.25
5.3.50.0060.02012.18
5.3.40.0060.02412.25
5.3.30.0090.03112.22
5.3.20.0040.02312.05
5.3.10.0060.01912.09
5.3.00.0060.02312.07
5.2.170.0000.05311.00
5.2.160.0000.06311.15
5.2.150.0100.02011.16
5.2.140.0000.03011.09
5.2.130.0030.03011.13
5.2.120.0000.02710.95
5.2.110.0130.02011.10
5.2.100.0100.04311.13
5.2.90.0000.03311.10
5.2.80.0030.02710.89
5.2.70.0030.04010.96
5.2.60.0030.02710.90
5.2.50.0130.05311.01
5.2.40.0170.03711.03
5.2.30.0030.06010.89
5.2.20.0070.05710.81
5.2.10.0000.04710.91
5.2.00.0030.06010.75
5.1.60.0070.03710.05
5.1.50.0030.05310.05
5.1.40.0070.0509.82
5.1.30.0100.05310.34
5.1.20.0070.05010.30
5.1.10.0070.05010.06
5.1.00.0100.05710.10
5.0.50.0000.0509.50
5.0.40.0000.0509.50
5.0.30.0000.0509.50
5.0.20.0000.0479.50
5.0.10.0070.0339.50
5.0.00.0030.0679.50
4.4.90.0000.0179.50
4.4.80.0030.0179.50
4.4.70.0030.0239.50
4.4.60.0030.0339.50
4.4.50.0030.0379.50
4.4.40.0030.0509.50
4.4.30.0070.0309.50
4.4.20.0030.0379.50
4.4.10.0000.0339.50
4.4.00.0030.0539.50
4.3.110.0070.0139.50
4.3.100.0030.0339.50
4.3.90.0000.0379.50
4.3.80.0030.0509.50
4.3.70.0030.0339.50
4.3.60.0100.0279.50
4.3.50.0030.0339.50
4.3.40.0030.0539.50
4.3.30.0030.0309.50
4.3.20.0030.0379.50
4.3.10.0000.0379.50
4.3.00.0030.0339.50

preferences:
42.41 ms | 401 KiB | 5 Q