3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'The refugee said "dam!"'; $bad_words = array("fug","schnitt","dam"); array_walk($bad_words, function($value, $key) { // this prepares the regex, requires PHP 5.3+ I think. return preg_quote('~\b' . $value . '\b~i'); // \b means word boundary, like space, line-break, and I think period, dash, and many others. Prevends "refudgee" from being matched when searching for "fudge" }); $good_words = array("fudge","shoot","dang"); $good_text = preg_replace($bad_words,$good_words,$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.00718.51
8.3.50.0070.01121.85
8.3.40.0080.01218.63
8.3.30.0140.00418.79
8.3.20.0000.00818.83
8.3.10.0040.00421.05
8.3.00.0080.00021.90
8.2.180.0120.00616.88
8.2.170.0040.01122.96
8.2.160.0100.00320.52
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00521.00
8.2.110.0090.00020.57
8.2.100.0070.00417.91
8.2.90.0080.00019.08
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0040.00418.00
8.2.30.0050.00319.37
8.2.20.0040.00417.76
8.2.10.0000.00717.73
8.2.00.0070.00417.72
8.1.280.0100.01025.92
8.1.270.0030.00623.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.57
8.1.230.0060.00620.99
8.1.220.0040.00418.77
8.1.210.0050.00319.03
8.1.200.0030.00617.35
8.1.190.0040.00417.53
8.1.180.0040.00418.10
8.1.170.0080.00018.50
8.1.160.0050.00318.96
8.1.150.0060.00318.63
8.1.140.0080.00017.38
8.1.130.0000.00717.84
8.1.120.0030.00317.48
8.1.110.0000.00717.42
8.1.100.0000.00717.47
8.1.90.0040.00417.38
8.1.80.0000.00717.43
8.1.70.0030.00317.35
8.1.60.0040.00417.48
8.1.50.0090.00017.39
8.1.40.0040.00417.50
8.1.30.0040.00417.57
8.1.20.0040.00417.63
8.1.10.0040.00417.57
8.1.00.0070.00017.42
8.0.300.0050.00319.98
8.0.290.0000.00817.18
8.0.280.0030.00418.55
8.0.270.0030.00317.30
8.0.260.0030.00316.81
8.0.250.0040.00416.99
8.0.240.0000.01017.09
8.0.230.0070.00017.05
8.0.220.0000.00816.90
8.0.210.0000.00616.82
8.0.200.0000.00616.92
8.0.190.0000.00916.98
8.0.180.0040.00416.88
8.0.170.0040.00416.93
8.0.160.0040.00316.97
8.0.150.0000.00716.86
8.0.140.0050.00316.84
8.0.130.0050.00013.34
8.0.120.0020.00516.93
8.0.110.0000.00716.91
8.0.100.0000.00716.76
8.0.90.0040.00416.94
8.0.80.0090.00616.92
8.0.70.0070.00016.77
8.0.60.0000.00716.90
8.0.50.0000.00716.78
8.0.30.0120.00617.22
8.0.20.0080.01717.40
8.0.10.0040.00417.19
8.0.00.0080.01216.84
7.4.330.0050.00016.84
7.4.320.0000.00616.42
7.4.300.0040.00416.59
7.4.290.0000.00716.43
7.4.280.0030.00316.49
7.4.270.0000.00616.52
7.4.260.0000.00613.29
7.4.250.0050.00216.32
7.4.240.0070.00016.57
7.4.230.0070.00016.55
7.4.220.0090.00916.54
7.4.210.0090.00816.61
7.4.200.0070.00016.34
7.4.190.0030.00316.55
7.4.160.0070.01016.55
7.4.150.0110.00717.40
7.4.140.0070.01017.86
7.4.130.0110.00616.50
7.4.120.0090.00816.52
7.4.110.0070.01016.57
7.4.100.0100.01316.53
7.4.90.0070.01016.77
7.4.80.0160.01319.39
7.4.70.0030.01316.43
7.4.60.0100.00616.54
7.4.50.0030.00616.49
7.4.40.0110.00722.77
7.4.30.0100.01016.68
7.4.00.0090.00515.09
7.3.330.0000.00513.43
7.3.320.0060.00013.23
7.3.310.0030.00316.19
7.3.300.0000.00716.17
7.3.290.0110.00716.30
7.3.280.0100.00916.37
7.3.270.0150.00917.40
7.3.260.0120.00818.24
7.3.250.0070.01016.36
7.3.240.0070.01116.23
7.3.230.0120.00616.39
7.3.210.0100.01316.41
7.3.200.0090.00919.39
7.3.190.0130.00616.54
7.3.180.0060.01516.39
7.3.170.0060.00916.44
7.3.160.0140.00316.34
7.3.120.0100.00714.79
7.3.110.0120.00615.05
7.3.100.0090.00614.93
7.3.90.0130.00314.66
7.3.80.0070.00714.95
7.3.70.0070.00714.92
7.3.60.0070.01014.62
7.3.50.0070.00714.72
7.3.40.0060.00914.71
7.3.30.0130.00314.87
7.3.20.0040.01216.32
7.3.10.0040.01116.70
7.3.00.0040.00816.48
7.2.330.0110.00716.51
7.2.320.0030.01416.37
7.2.310.0130.00616.72
7.2.300.0110.00516.43
7.2.290.0040.01316.34
7.2.250.0160.00314.85
7.2.240.0070.01115.32
7.2.230.0030.00714.64
7.2.220.0030.01014.90
7.2.210.0030.01214.95
7.2.200.0100.00614.95
7.2.190.0060.01215.14
7.2.180.0100.00614.77
7.2.170.0050.00515.02
7.2.60.0060.00616.73
7.2.00.0090.00919.38
7.1.330.0110.00415.59
7.1.320.0130.00315.85
7.1.310.0090.00615.74
7.1.300.0000.01715.76
7.1.290.0070.00715.42
7.1.280.0070.00715.75
7.1.270.0070.01015.59
7.1.260.0030.01315.78
7.1.200.0090.00615.92
7.1.100.0000.01118.27
7.1.70.0040.00416.98
7.1.60.0100.01419.40
7.1.50.0100.01316.77
7.1.00.0030.03322.30
7.0.200.0040.00416.68
7.0.140.0030.07322.12
7.0.100.0100.07319.95
7.0.90.0130.04719.92
7.0.80.0170.07019.88
7.0.70.0100.08019.89
7.0.60.0070.04719.93
7.0.50.0270.04720.38
7.0.40.0130.07319.95
7.0.30.0030.09019.92
7.0.20.0230.06719.95
7.0.10.0130.08020.18
7.0.00.0030.05720.14
5.6.280.0100.06720.91
5.6.250.0070.04320.72
5.6.240.0170.07720.61
5.6.230.0130.07320.74
5.6.220.0100.08020.71
5.6.210.0100.07720.46
5.6.200.0130.03721.04
5.6.190.0100.05721.10
5.6.180.0070.08021.04
5.6.170.0100.04321.02
5.6.160.0100.08021.07
5.6.150.0030.09021.09
5.6.140.0100.04721.07
5.6.130.0000.09721.14
5.6.120.0030.06320.95
5.6.110.0030.05321.00
5.6.100.0030.08721.10
5.6.90.0100.09020.91
5.6.80.0100.04720.50
5.6.70.0130.07720.48
5.6.60.0070.08020.50
5.6.50.0030.07020.34
5.6.40.0070.08320.49
5.6.30.0070.07320.30
5.6.20.0070.04720.38
5.6.10.0100.06720.41
5.6.00.0130.07320.29
5.5.380.0070.07320.50
5.5.370.0130.07320.39
5.5.360.0070.08320.41
5.5.350.0230.06720.39
5.5.340.0030.07320.93
5.5.330.0030.06320.65
5.5.320.0100.04720.80
5.5.310.0130.04320.90
5.5.300.0070.05720.77
5.5.290.0070.08720.90
5.5.280.0030.09320.73
5.5.270.0170.05720.86
5.5.260.0070.04020.86
5.5.250.0030.08320.73
5.5.240.0070.07320.25
5.5.230.0100.07320.22
5.5.220.0130.06320.27
5.5.210.0170.05020.21
5.5.200.0070.05320.22
5.5.190.0070.08020.23
5.5.180.0030.08320.21
5.5.160.0000.05020.24
5.5.150.0030.08320.25
5.5.140.0100.07720.08
5.5.130.0130.07020.19
5.5.120.0070.08020.18
5.5.110.0170.06719.99
5.5.100.0030.08020.10
5.5.90.0070.08020.05
5.5.80.0100.07320.09
5.5.70.0030.04720.05
5.5.60.0130.06320.15
5.5.50.0100.05720.05
5.5.40.0070.04320.12
5.5.30.0000.04719.93
5.5.20.0070.07720.11
5.5.10.0170.07020.05
5.5.00.0100.05719.97
5.4.450.0170.07019.49
5.4.440.0070.04319.45
5.4.430.0130.03019.44
5.4.420.0100.06019.47
5.4.410.0000.08019.37
5.4.400.0100.05318.86
5.4.390.0030.07719.05
5.4.380.0100.07019.18
5.4.370.0100.07019.10
5.4.360.0000.04719.00
5.4.350.0130.06718.87
5.4.340.0030.07719.15
5.4.320.0130.07319.04
5.4.310.0070.05018.88
5.4.300.0100.05019.18
5.4.290.0130.05319.12
5.4.280.0130.05318.90
5.4.270.0070.06719.04
5.4.260.0100.09019.13
5.4.250.0070.03719.03
5.4.240.0130.06719.12
5.4.230.0030.04719.12
5.4.220.0070.07319.04
5.4.210.0070.04319.02
5.4.200.0000.08319.12
5.4.190.0000.08319.22
5.4.180.0030.08019.11
5.4.170.0070.07019.12
5.4.160.0070.07319.12
5.4.150.0030.06719.03
5.4.140.0030.04716.41
5.4.130.0070.07316.34
5.4.120.0000.08016.43
5.4.110.0000.06016.50
5.4.100.0000.04316.39
5.4.90.0070.07016.44
5.4.80.0070.06316.41
5.4.70.0030.03716.45
5.4.60.0030.05316.40
5.4.50.0070.06316.36
5.4.40.0170.04716.50
5.4.30.0170.05716.36
5.4.20.0000.04316.48
5.4.10.0070.05716.48
5.4.00.0070.06015.86
5.3.290.0130.06315.74
5.3.280.0130.05315.74
5.3.270.0030.06315.74
5.3.260.0100.05715.74
5.3.250.0070.07715.74
5.3.240.0030.04715.74
5.3.230.0130.05315.74
5.3.220.0070.07015.74
5.3.210.0070.04315.74
5.3.200.0070.04015.74
5.3.190.0070.04015.74
5.3.180.0200.06315.74
5.3.170.0130.05715.74
5.3.160.0030.07715.74
5.3.150.0030.03315.74
5.3.140.0100.07015.74
5.3.130.0070.03315.74
5.3.120.0100.06315.74
5.3.110.0100.05315.74
5.3.100.0070.07715.74
5.3.90.0070.04715.74
5.3.80.0170.06315.74
5.3.70.0100.03715.74
5.3.60.0130.06315.74
5.3.50.0070.07715.74
5.3.40.0070.06315.74
5.3.30.0030.07315.74
5.3.20.0070.07315.74
5.3.10.0130.04315.74
5.3.00.0070.04715.74
5.2.170.0070.05015.74
5.2.160.0000.05315.74
5.2.150.0100.04715.74
5.2.140.0100.03315.74
5.2.130.0070.05315.74
5.2.120.0030.06315.74
5.2.110.0070.05715.74
5.2.100.0030.03015.74
5.2.90.0030.06715.74
5.2.80.0070.05715.74
5.2.70.0100.02715.74
5.2.60.0000.06315.74
5.2.50.0070.04015.74
5.2.40.0000.03715.74
5.2.30.0000.06015.74
5.2.20.0070.05015.74
5.2.10.0070.03315.74
5.2.00.0130.05315.74
5.1.60.0030.02715.74
5.1.50.0030.05015.74
5.1.40.0030.04715.74
5.1.30.0000.05715.74
5.1.20.0070.05715.74
5.1.10.0000.04715.74
5.1.00.0070.03315.74
5.0.50.0000.03715.74
5.0.40.0070.02015.74
5.0.30.0030.05015.74
5.0.20.0130.03715.74
5.0.10.0030.02315.74
5.0.00.0070.05315.74
4.4.90.0030.03315.74
4.4.80.0030.03015.74
4.4.70.0000.01715.74
4.4.60.0030.01715.74
4.4.50.0100.02315.74
4.4.40.0000.05715.74
4.4.30.0070.03015.74
4.4.20.0100.01315.74
4.4.10.0070.03015.74
4.4.00.0000.05315.74
4.3.110.0100.02315.74
4.3.100.0070.02015.74
4.3.90.0000.02015.74
4.3.80.0000.03715.74
4.3.70.0030.02715.74
4.3.60.0070.03015.74
4.3.50.0000.03715.74
4.3.40.0000.05315.74
4.3.30.0000.03715.74
4.3.20.0000.03715.74
4.3.10.0000.02015.74
4.3.00.0000.03315.74

preferences:
43.24 ms | 401 KiB | 5 Q