3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* 7. Write a PHP script to remove all characters from a string except a-z A-Z 0-9 or " ". Go to the editor Sample string : abcde$ddfd @abcd )der] Expected Result : abcdeddfd abcd der - See more at: http://www.w3resource.com/php-exercises/php-regular-expression-exercises.php#sthash.fzCJEK6c.dpuf */ $text = 'abcde$ddfd @abcd )der]'; $reg = "/[^a-zA-Z0-9]/"; print preg_replace($reg, "", $text); ?>

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.01416.75
8.3.50.0140.00322.04
8.3.40.0070.00718.84
8.3.30.0000.01418.96
8.3.20.0050.00220.32
8.3.10.0050.00323.48
8.3.00.0040.00419.05
8.2.180.0080.01216.63
8.2.170.0060.00922.96
8.2.160.0070.00720.43
8.2.150.0060.00324.18
8.2.140.0070.00024.66
8.2.130.0060.00326.16
8.2.120.0080.00019.48
8.2.110.0060.00321.93
8.2.100.0130.00020.53
8.2.90.0030.00619.22
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0090.00317.80
8.2.50.0080.00018.07
8.2.40.0080.00418.19
8.2.30.0040.00418.38
8.2.20.0000.00717.83
8.2.10.0020.00518.02
8.2.00.0000.00719.61
8.1.280.0200.00025.92
8.1.270.0040.00422.06
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00322.09
8.1.230.0090.00319.00
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.48
8.1.190.0050.00217.35
8.1.180.0040.00418.10
8.1.170.0050.00318.79
8.1.160.0040.00321.89
8.1.150.0020.00518.63
8.1.140.0040.00417.58
8.1.130.0030.00317.84
8.1.120.0000.00717.43
8.1.110.0070.00017.59
8.1.100.0070.00017.60
8.1.90.0040.00417.61
8.1.80.0070.00317.43
8.1.70.0040.00417.48
8.1.60.0040.00417.69
8.1.50.0000.00817.61
8.1.40.0020.00517.49
8.1.30.0000.00917.70
8.1.20.0050.00317.75
8.1.10.0050.00217.54
8.1.00.0000.00717.63
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0000.00718.38
8.0.270.0030.00317.28
8.0.260.0000.00717.21
8.0.250.0000.00717.13
8.0.240.0030.00717.07
8.0.230.0000.00716.93
8.0.220.0030.00316.88
8.0.210.0000.00716.96
8.0.200.0000.00717.05
8.0.190.0000.00717.07
8.0.180.0000.00717.03
8.0.170.0060.00316.99
8.0.160.0000.00716.91
8.0.150.0000.00716.87
8.0.140.0030.00616.90
8.0.130.0030.00313.41
8.0.120.0030.00616.89
8.0.110.0040.00416.95
8.0.100.0080.00016.84
8.0.90.0000.00716.77
8.0.80.0000.01717.03
8.0.70.0050.00316.84
8.0.60.0000.00717.04
8.0.50.0040.00416.85
8.0.30.0030.01517.37
8.0.20.0070.01117.40
8.0.10.0040.00317.10
8.0.00.0140.00916.83
7.4.330.0060.00015.00
7.4.320.0030.00316.56
7.4.300.0060.00016.54
7.4.290.0000.00716.79
7.4.280.0030.00616.56
7.4.270.0000.00816.73
7.4.260.0070.00016.62
7.4.250.0000.00716.60
7.4.240.0040.00316.77
7.4.230.0030.00316.54
7.4.220.0100.01016.83
7.4.210.0110.00716.75
7.4.200.0030.00716.68
7.4.160.0070.01116.48
7.4.150.0030.01517.40
7.4.140.0150.00617.86
7.4.130.0090.01116.72
7.4.120.0130.00416.71
7.4.110.0100.00716.82
7.4.100.0150.00616.57
7.4.90.0130.00316.57
7.4.80.0000.01819.39
7.4.70.0110.00616.80
7.4.60.0130.00316.55
7.4.50.0000.00416.62
7.4.40.0070.01416.66
7.4.30.0070.01016.66
7.4.00.0040.00815.09
7.3.330.0000.00613.08
7.3.320.0000.00613.12
7.3.310.0030.00316.35
7.3.300.0000.00616.12
7.3.290.0090.00916.24
7.3.280.0070.01116.28
7.3.270.0100.00917.40
7.3.260.0110.00616.47
7.3.250.0140.00416.62
7.3.240.0180.00416.58
7.3.230.0060.00916.64
7.3.210.0160.00616.64
7.3.200.0100.00619.39
7.3.190.0100.00716.24
7.3.180.0110.00416.80
7.3.170.0100.00616.54
7.3.160.0100.00616.54
7.3.120.0080.00914.96
7.3.110.0120.00614.86
7.3.100.0060.00614.78
7.3.90.0090.00914.54
7.3.80.0070.00714.61
7.3.70.0030.01014.98
7.3.60.0060.00314.63
7.3.50.0060.01214.66
7.3.40.0000.01614.96
7.3.30.0100.00014.72
7.3.20.0080.00316.85
7.3.10.0140.00416.54
7.3.00.0110.00316.49
7.2.330.0090.01316.58
7.2.320.0030.01316.57
7.2.310.0090.01216.50
7.2.300.0070.01016.44
7.2.290.0100.00716.80
7.2.250.0040.01514.96
7.2.240.0030.01714.89
7.2.230.0040.01115.10
7.2.220.0050.01015.14
7.2.210.0030.01214.81
7.2.200.0000.00915.29
7.2.190.0000.01315.04
7.2.180.0000.01514.82
7.2.170.0060.00314.89
7.2.130.0140.01016.56
7.2.120.0100.01216.65
7.2.110.0090.00916.34
7.2.100.0100.01316.57
7.2.90.0130.00416.73
7.2.80.0160.01316.64
7.2.70.0160.00616.44
7.2.60.0060.00916.34
7.2.50.0180.00016.75
7.2.40.0060.01516.77
7.2.30.0030.01016.63
7.2.20.0130.00916.51
7.2.10.0100.00616.43
7.2.00.0050.00818.17
7.1.330.0070.00716.02
7.1.320.0090.00916.09
7.1.310.0080.00416.07
7.1.300.0030.00915.76
7.1.290.0000.01516.03
7.1.280.0000.01315.64
7.1.270.0000.01015.95
7.1.260.0060.00615.59
7.1.250.0030.00915.50
7.1.100.0190.00418.21
7.1.70.0030.00616.94
7.1.60.0150.00017.50
7.1.50.0110.01117.13
7.1.00.0130.06722.59
7.0.200.0090.00617.00
7.0.140.0070.07021.95
7.0.60.0070.06019.94
7.0.50.0100.07717.89
7.0.40.0030.07720.07
7.0.30.0270.03320.14
7.0.20.0370.05020.24
7.0.10.0100.06720.05
7.0.00.0100.08020.07
5.6.210.0130.07320.56
5.6.200.0030.06318.16
5.6.190.0170.08020.35
5.6.180.3370.04320.27
5.6.170.0230.04720.71
5.6.160.0070.04720.32
5.6.150.0130.07718.11
5.6.140.0070.07018.09
5.6.130.0070.08018.07
5.6.120.0130.06021.09
5.6.110.0070.07320.98
5.6.100.0030.09321.01
5.6.90.0070.09021.09
5.6.80.0130.07020.52
5.6.70.3370.03720.38
5.5.350.0070.07720.34
5.5.340.0000.04017.96
5.5.330.0070.08320.47
5.5.320.0230.08320.13
5.5.310.0230.08320.30
5.5.300.0170.06317.87
5.5.290.0000.04717.98
5.5.280.0000.04720.73
5.5.270.0100.05020.75
5.5.260.0100.08020.75
5.5.250.0130.03320.59
5.5.240.0230.08020.28
5.4.450.0170.05731.27
5.4.440.0400.05030.96
5.4.430.0400.04029.30
5.4.420.0370.04029.29
5.4.410.0330.04329.27
5.4.400.0230.03728.90
5.4.390.0100.04726.75
5.4.380.0100.05718.66
5.4.370.0300.03718.46
5.4.360.0070.05718.58
5.4.350.0130.05318.67
5.4.340.0200.04718.68
5.4.320.0080.03712.46
5.4.310.0060.04212.45
5.4.300.0060.03512.45
5.4.290.0050.03812.45
5.4.280.0050.03612.35
5.4.270.0070.03512.35
5.4.260.0060.03712.35
5.4.250.0060.03612.35
5.4.240.0100.04912.35
5.4.230.0050.03812.34
5.4.220.0060.03912.34
5.4.210.0070.03912.34
5.4.200.0070.04112.34
5.4.190.0080.04312.33
5.4.180.0100.03112.33
5.4.170.0090.03312.34
5.4.160.0060.05312.34
5.4.150.0050.03612.33
5.4.140.0050.03812.02
5.4.130.0060.04112.01
5.4.120.0080.03111.97
5.4.110.0060.04511.96
5.4.100.0060.03911.96
5.4.90.0040.04511.96
5.4.80.0060.04211.96
5.4.70.0040.03511.96
5.4.60.0060.03411.96
5.4.50.0080.04311.96
5.4.40.0040.03711.95
5.4.30.0060.04411.95
5.4.20.0040.03611.95
5.4.10.0050.04211.95
5.4.00.0050.03611.44
5.3.290.0040.04412.80
5.3.280.0090.04112.71
5.3.270.0070.03812.72
5.3.260.0070.03712.72
5.3.250.0060.03712.72
5.3.240.0050.03712.72
5.3.230.0090.03512.71
5.3.220.0060.03612.68
5.3.210.0080.03812.68
5.3.200.0070.04112.68
5.3.190.0040.03912.67
5.3.180.0070.03612.68
5.3.170.0040.03812.67
5.3.160.0070.03612.67
5.3.150.0090.04112.67
5.3.140.0090.03312.66
5.3.130.0050.04012.66
5.3.120.0070.03812.66
5.3.110.0040.04112.66
5.3.100.0060.04112.12
5.3.90.0080.03312.09
5.3.80.0060.04312.07
5.3.70.0030.04412.07
5.3.60.0050.04112.07
5.3.50.0080.04012.00
5.3.40.0070.03512.00
5.3.30.0060.03511.94
5.3.20.0060.03811.72
5.3.10.0060.03411.69
5.3.00.0080.04611.67
5.2.170.0040.0319.18
5.2.160.0040.0309.18
5.2.150.0080.0289.18
5.2.140.0040.0319.18
5.2.130.0040.0319.13
5.2.120.0090.0279.14
5.2.110.0050.0289.14
5.2.100.0070.0259.13
5.2.90.0070.0279.13
5.2.80.0060.0289.13
5.2.70.0040.0319.13
5.2.60.0110.0299.09
5.2.50.0040.0299.05
5.2.40.0040.0299.03
5.2.30.0050.0299.01
5.2.20.0020.0319.00
5.2.10.0020.0318.92
5.2.00.0050.0288.78
5.1.60.0040.0308.06
5.1.50.0000.0288.05
5.1.40.0030.0258.04
5.1.30.0050.0258.39
5.1.20.0040.0268.41
5.1.10.0060.0308.13
5.1.00.0060.0318.14
5.0.50.0050.0186.61
5.0.40.0040.0306.47
5.0.30.0050.0406.29
5.0.20.0030.0206.26
5.0.10.0090.0316.23
5.0.00.0060.0276.23
4.4.90.0030.0154.78
4.4.80.0050.0124.75
4.4.70.0020.0154.75
4.4.60.0060.0134.75
4.4.50.0030.0234.77
4.4.40.0000.0284.71
4.4.30.0030.0154.76
4.4.20.0010.0174.84
4.4.10.0030.0154.84
4.4.00.0040.0234.76
4.3.110.0010.0174.67
4.3.100.0030.0144.66
4.3.90.0030.0144.64
4.3.80.0000.0264.59
4.3.70.0010.0164.63
4.3.60.0020.0154.63
4.3.50.0030.0164.63
4.3.40.0020.0234.54
4.3.30.0030.0153.28
4.3.20.0020.0163.25
4.3.10.0020.0153.21
4.3.00.0100.01325.98

preferences:
45.93 ms | 401 KiB | 5 Q