3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str='Película; Films; @Cine; Añoranza; <html></body>foo "bar ";'; var_dump($str); $a = preg_replace('/[^\sa-zA-Z0-9áéíóúüñÁÉÍÓÚÜÑ]+/u', '', $str); $a = preg_replace('/\s+/', ' ', $a); var_dump($a); $b = preg_replace('/[^\sa-zA-Z0-9áéíóúüñÁÉÍÓÚÜÑ]+/', '', $str); $b = preg_replace('/\s+/', ' ', $b); var_dump($b);

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.40.0080.00818.85
8.3.30.0090.00618.82
8.3.20.0000.00818.75
8.3.10.0050.00320.64
8.3.00.0050.00317.75
8.2.170.0120.00322.96
8.2.160.0110.00422.09
8.2.150.0100.01024.18
8.2.140.0050.00524.66
8.2.130.0050.00326.16
8.2.120.0040.00419.72
8.2.110.0070.00322.25
8.2.100.0040.00718.03
8.2.90.0030.00519.05
8.2.80.0000.00817.97
8.2.70.0080.00017.75
8.2.60.0030.00517.92
8.2.50.0040.00418.07
8.2.40.0000.00818.22
8.2.30.0060.00317.98
8.2.20.0040.00417.94
8.2.10.0030.00617.97
8.2.00.0040.00418.02
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00322.41
8.1.230.0000.01120.97
8.1.220.0080.00018.77
8.1.210.0040.00418.91
8.1.200.0030.00717.48
8.1.190.0000.00717.52
8.1.180.0060.00318.10
8.1.170.0040.00418.77
8.1.160.0000.00718.83
8.1.150.0040.00418.80
8.1.140.0080.00017.52
8.1.130.0000.00717.84
8.1.120.0000.00717.53
8.1.110.0040.00417.54
8.1.100.0030.00517.59
8.1.90.0050.00317.49
8.1.80.0070.00017.59
8.1.70.0030.00317.45
8.1.60.0040.00417.64
8.1.50.0060.00317.57
8.1.40.0030.00617.65
8.1.30.0040.00417.79
8.1.20.0040.00417.79
8.1.10.0040.00417.57
8.1.00.0080.00017.54
8.0.300.0060.00320.02
8.0.290.0070.00016.88
8.0.280.0000.00718.40
8.0.270.0030.00317.23
8.0.260.0030.00316.99
8.0.250.0000.00816.99
8.0.240.0000.00817.09
8.0.230.0040.00417.05
8.0.220.0030.00317.02
8.0.210.0000.00716.98
8.0.200.0000.00717.09
8.0.190.0030.00517.11
8.0.180.0040.00417.07
8.0.170.0060.00317.04
8.0.160.0000.00716.95
8.0.150.0030.00517.04
8.0.140.0060.00317.02
8.0.130.0030.00313.53
8.0.120.0000.00816.97
8.0.110.0040.00417.13
8.0.100.0040.00417.13
8.0.90.0070.00017.10
8.0.80.0030.01217.06
8.0.70.0040.00416.93
8.0.60.0060.00317.18
8.0.50.0070.00017.05
8.0.30.0110.00917.16
8.0.20.0080.01117.40
8.0.10.0040.00417.07
8.0.00.0140.00617.00
7.4.330.0030.00314.93
7.4.320.0000.00616.72
7.4.300.0030.00316.72
7.4.290.0030.00316.63
7.4.280.0070.00016.71
7.4.270.0030.00316.81
7.4.260.0030.00313.51
7.4.250.0040.00416.84
7.4.240.0080.00016.75
7.4.230.0030.00316.90
7.4.220.0140.01216.76
7.4.210.0080.01016.72
7.4.200.0070.00016.54
7.4.190.0080.00016.73
7.4.160.0030.01416.46
7.4.150.0060.01217.18
7.4.140.0080.01017.33
7.4.130.0150.00616.63
7.4.120.0080.01116.63
7.4.110.0140.00716.72
7.4.100.0070.01016.57
7.4.90.0120.00616.63
7.4.80.0100.01118.80
7.4.70.0070.01016.66
7.4.60.0040.01316.58
7.4.50.0080.00016.70
7.4.40.0070.01022.27
7.4.30.0100.00716.79
7.4.00.0060.00814.87
7.3.330.0000.00613.23
7.3.320.0050.00013.06
7.3.310.0040.00416.18
7.3.300.0030.00316.40
7.3.290.0130.00316.33
7.3.280.0080.00916.42
7.3.270.0060.01017.40
7.3.260.0070.01018.24
7.3.250.0090.01216.49
7.3.240.0100.00716.67
7.3.230.0150.00316.58
7.3.210.0080.00816.49
7.3.200.0110.01119.39
7.3.190.0070.01516.41
7.3.180.0100.00616.68
7.3.170.0090.00916.67
7.3.160.0110.00616.31
7.3.120.0030.01314.92
7.2.330.0090.00916.63
7.2.320.0130.00316.60
7.2.310.0080.01116.59
7.2.300.0060.01116.79
7.2.290.0070.01116.71
7.2.80.0130.00316.65
7.1.200.0120.00015.86
7.1.70.0070.00317.18
7.1.60.0070.00717.42
7.1.50.0040.01117.15
7.1.00.0070.03722.42
7.0.200.0030.01016.71
7.0.140.0070.07022.12
7.0.60.0030.09320.00
7.0.50.0030.09017.88
7.0.40.0030.07317.75
7.0.30.0130.07717.67
7.0.20.0130.07717.76
7.0.10.0070.09317.76
7.0.00.0030.08317.80
5.6.280.0100.06721.13
5.6.210.0070.04320.54
5.6.200.0130.07318.23
5.6.190.0070.08018.15
5.6.180.0070.08018.18
5.6.170.0100.07018.18
5.6.160.0070.08018.16
5.6.150.0030.06318.12
5.6.140.0070.08018.16
5.6.130.0100.08018.18
5.6.120.0170.07318.07
5.6.110.0100.08018.11
5.6.100.0030.05018.21
5.6.90.0130.08018.17
5.6.80.0000.05017.61
5.6.70.0030.04717.55
5.6.60.0130.03717.54
5.6.50.0030.04717.57
5.6.40.0030.06717.57
5.6.30.0100.03017.57
5.6.20.0100.05717.50
5.6.10.0070.04017.46
5.6.00.0030.05717.42
5.5.350.3200.03320.38
5.5.340.0070.06317.89
5.5.330.0070.08718.01
5.5.320.0130.07717.88
5.5.310.0070.07718.02
5.5.300.0100.06317.94
5.5.290.0130.07718.00
5.5.280.0130.07718.02
5.5.270.0170.07017.91
5.5.260.0030.05017.88
5.5.250.0000.09017.79
5.5.240.0030.05017.37
5.5.230.0100.04017.30
5.5.220.0100.03317.35
5.5.210.0070.03717.38
5.5.200.0130.06717.26
5.5.190.0100.03317.30
5.5.180.0070.06717.27
5.5.160.0000.08017.22
5.5.150.0000.04717.33
5.5.140.0070.07717.37
5.5.130.0000.05317.34
5.5.120.0070.07717.26
5.5.110.0070.08017.32
5.5.100.0070.06717.27
5.5.90.0130.06717.14
5.5.80.0130.04717.20
5.5.70.0030.04317.22
5.5.60.0000.04017.25
5.5.50.0070.07317.25
5.5.40.0000.04317.16
5.5.30.0070.05017.16
5.5.20.0030.07717.20
5.5.10.0030.07017.16
5.5.00.0070.04317.12
5.4.450.0170.07019.29
5.4.440.0100.06319.36
5.4.430.0100.07719.41
5.4.420.0000.04319.41
5.4.410.0070.05319.32
5.4.400.0130.06719.08
5.4.390.0130.07019.03
5.4.380.0070.06018.89
5.4.370.0170.07019.07
5.4.360.0100.03319.07
5.4.350.0030.04319.03
5.4.340.0030.04719.12
5.4.320.0000.06318.97
5.4.310.0100.04718.91
5.4.300.0030.06719.06
5.4.290.0070.07718.98
5.4.280.0100.04719.02
5.4.270.0100.07318.88
5.4.260.0170.05318.99
5.4.250.0070.05719.07
5.4.240.0070.04319.13
5.4.230.0030.06019.20
5.4.220.0000.04718.97
5.4.210.0070.04319.20
5.4.200.0000.04719.00
5.4.190.0100.03719.00
5.4.180.0230.06319.02
5.4.170.0070.03719.02
5.4.160.0030.04019.01
5.4.150.0030.07718.97
5.4.140.0130.04716.53
5.4.130.0070.06716.36
5.4.120.0030.07316.22
5.4.110.0030.07716.28
5.4.100.0000.05716.41
5.4.90.0170.05716.44
5.4.80.0030.06316.29
5.4.70.0070.07016.29
5.4.60.0000.06316.23
5.4.50.0030.08016.34
5.4.40.0200.06316.39
5.4.30.0000.04716.50
5.4.20.0030.07716.37
5.4.10.0070.07716.47
5.4.00.0030.07315.75
5.3.290.0030.08714.64
5.3.280.0030.04014.57
5.3.270.0030.04714.58
5.3.260.0030.04014.43
5.3.250.0000.04314.44
5.3.240.0130.03314.52
5.3.230.0170.05314.56
5.3.220.0100.07014.48
5.3.210.0130.07014.50
5.3.200.0130.06714.34
5.3.190.0030.08314.50
5.3.180.0030.08014.39
5.3.170.0030.04714.54
5.3.160.0030.06714.52
5.3.150.0030.08014.50
5.3.140.0030.05014.39
5.3.130.0070.08014.52
5.3.120.0100.07314.36
5.3.110.0170.05314.51
5.3.100.0100.04013.97
5.3.90.0100.07013.95
5.3.80.0100.07013.78
5.3.70.0100.07013.97
5.3.60.0130.06713.97
5.3.50.0070.07713.90
5.3.40.0100.06013.80
5.3.30.0100.06713.98
5.3.20.0000.06713.66
5.3.10.0070.05013.43
5.3.00.0000.04013.57
5.2.170.0170.05011.13
5.2.160.0130.04011.11
5.2.150.0070.05711.11
5.2.140.0070.06011.13
5.2.130.0030.07010.92
5.2.120.0000.03011.09
5.2.110.0100.05011.07
5.2.100.0100.05310.88
5.2.90.0030.06311.07
5.2.80.0070.06011.12
5.2.70.0070.06011.03
5.2.60.0030.05011.19
5.2.50.0070.05310.96
5.2.40.0070.03310.99
5.2.30.0030.04310.91
5.2.20.0070.05710.94
5.2.10.0070.03010.83
5.2.00.0070.02710.64
5.1.60.0000.03010.13
5.1.50.0030.03010.14
5.1.40.0070.0479.96
5.1.30.0000.03710.36
5.1.20.0070.05010.36
5.1.10.0070.04310.09
5.1.00.0100.05010.21
5.0.50.0030.0508.46
5.0.40.0030.0478.33
5.0.30.0030.0638.21
5.0.20.0030.0208.10
5.0.10.0000.0408.15
5.0.00.0070.0608.14
4.4.90.0000.0338.09
4.4.80.0030.0238.09
4.4.70.0070.0178.09
4.4.60.0070.0208.09
4.4.50.0000.0208.09
4.4.40.0000.0538.09
4.4.30.0070.0338.09
4.4.20.0000.0338.09
4.4.10.0070.0338.09
4.4.00.0030.0338.09
4.3.110.0100.0138.09
4.3.100.0030.0278.09
4.3.90.0070.0338.09
4.3.80.0030.0538.09
4.3.70.0070.0238.09
4.3.60.0030.0338.09
4.3.50.0000.0238.09
4.3.40.0030.0278.09
4.3.30.0000.0278.09
4.3.20.0030.0338.09
4.3.10.0030.0238.09
4.3.00.0000.0208.09

preferences:
49.3 ms | 400 KiB | 5 Q