3v4l.org

run code in 300+ PHP versions simultaneously
<?php $originalString = 'Her (III.1) was the age of 2 years and 11 months. (shoulder a 4/5)'; $findStringArray = array("age", "(III.1)", "2", "months", "4"); $words = explode(" ",$originalString); for($x = 0; $x<count($words); $x++) { foreach($findStringArray as $key => $value) { $originalString = preg_replace('/\b('.preg_quote($value).')\b/i', "__", $originalString); if ($words[$x] == $value) { $words[$x] = preg_replace('/\b('.preg_quote($value).')\b/i', "__", $words[$x]); } } } $newstring = implode(" ", $words); echo $newstring;

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.0030.01216.63
8.3.50.0060.01418.34
8.3.40.0110.00319.09
8.3.30.0070.00719.17
8.3.20.0070.00020.38
8.3.10.0000.00721.87
8.3.00.0030.00919.08
8.2.180.0130.00618.54
8.2.170.0070.00722.96
8.2.160.0140.00020.53
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.79
8.2.110.0130.01022.42
8.2.100.0090.00317.88
8.2.90.0000.00819.21
8.2.80.0060.00317.97
8.2.70.0050.00317.88
8.2.60.0070.00417.93
8.2.50.0040.00518.07
8.2.40.0000.00818.20
8.2.30.0080.00418.22
8.2.20.0030.00517.95
8.2.10.0050.00318.04
8.2.00.0040.00418.03
8.1.280.0150.00025.92
8.1.270.0060.00320.73
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00423.92
8.1.230.0120.00020.88
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0040.00817.48
8.1.190.0060.00317.35
8.1.180.0080.00018.10
8.1.170.0060.00318.62
8.1.160.0060.00321.91
8.1.150.0040.00418.91
8.1.140.0030.00617.63
8.1.130.0040.00417.86
8.1.120.0040.00417.63
8.1.110.0000.00817.50
8.1.100.0040.00417.55
8.1.90.0000.00717.50
8.1.80.0000.00717.65
8.1.70.0040.00417.53
8.1.60.0040.00417.62
8.1.50.0030.00517.57
8.1.40.0060.00317.64
8.1.30.0000.00917.77
8.1.20.0040.00417.85
8.1.10.0040.00417.55
8.1.00.0090.00017.64
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0030.00318.38
8.0.270.0050.00317.28
8.0.260.0050.00318.48
8.0.250.0000.00717.00
8.0.240.0040.00417.09
8.0.230.0040.00417.10
8.0.220.0070.00016.93
8.0.210.0040.00417.02
8.0.200.0000.00617.02
8.0.190.0040.00416.99
8.0.180.0050.00216.96
8.0.170.0000.00817.06
8.0.160.0040.00417.09
8.0.150.0000.00817.03
8.0.140.0040.00416.92
8.0.130.0030.00313.46
8.0.120.0000.00816.89
8.0.110.0070.00016.96
8.0.100.0000.00716.93
8.0.90.0040.00417.07
8.0.80.0100.00717.05
8.0.70.0040.00416.93
8.0.60.0070.00017.01
8.0.50.0000.00717.02
8.0.30.0060.01517.28
8.0.20.0140.00817.40
8.0.10.0080.00017.07
8.0.00.0080.01016.92
7.4.330.0030.00315.07
7.4.320.0000.00616.77
7.4.300.0030.00316.82
7.4.290.0030.00616.72
7.4.280.0000.01016.71
7.4.270.0030.00316.84
7.4.260.0070.00316.81
7.4.250.0000.00816.67
7.4.240.0020.00516.78
7.4.230.0000.00716.92
7.4.220.0030.01516.71
7.4.210.0090.00616.81
7.4.200.0070.00016.93
7.4.160.0160.00016.47
7.4.150.0100.01017.40
7.4.140.0100.00817.86
7.4.130.0110.00616.76
7.4.120.0110.01016.72
7.4.110.0160.00316.62
7.4.100.0110.01416.61
7.4.90.0060.01216.81
7.4.80.0110.01119.39
7.4.70.0140.00316.75
7.4.60.0080.00816.59
7.4.50.0040.00416.64
7.4.40.0030.01416.59
7.4.30.0130.01016.66
7.4.00.0070.01114.99
7.3.330.0000.00513.40
7.3.320.0090.00613.31
7.3.310.0070.00016.52
7.3.300.0070.00016.47
7.3.290.0000.00616.45
7.3.280.0080.01216.48
7.3.270.0110.01217.40
7.3.260.0110.00716.64
7.3.250.0110.00616.59
7.3.240.0070.01416.64
7.3.230.0070.01716.66
7.3.210.0120.00416.52
7.3.200.0090.01119.39
7.3.190.0060.01516.70
7.3.180.0070.01416.61
7.3.170.0000.01716.77
7.3.160.0110.00616.42
7.2.330.0120.00616.91
7.2.320.0110.00616.73
7.2.310.0140.00316.94
7.2.300.0140.00316.88
7.2.290.0100.00716.84
7.2.00.0060.00619.68
7.1.100.0320.00618.48
7.1.70.0000.01417.44
7.1.60.0100.01019.46
7.1.50.0140.01016.94
7.1.00.0070.07322.59
7.0.200.0130.00016.84
7.0.140.0000.07322.17
7.0.70.4400.04019.94
7.0.60.0100.07019.92
7.0.50.0100.07717.84
7.0.40.0100.07019.91
7.0.30.0130.05020.22
7.0.20.0330.07320.19
7.0.10.0200.04320.20
7.0.00.0100.08720.18
5.6.280.0030.07321.10
5.6.210.0070.08320.75
5.6.200.0170.07318.13
5.6.190.0070.05320.34
5.6.180.0170.05020.66
5.6.170.0430.05020.41
5.6.160.0030.04320.48
5.6.150.0030.04018.12
5.6.140.0130.08018.18
5.6.130.0130.08018.12
5.6.120.0030.08020.98
5.6.110.0070.08720.98
5.6.100.0000.09020.98
5.6.90.0070.05021.07
5.6.80.0070.03320.37
5.6.70.0170.03020.37
5.5.350.0100.05020.39
5.5.340.0000.04017.97
5.5.330.0100.08020.21
5.5.320.0130.07320.17
5.5.310.0270.07720.41
5.5.300.0070.03717.92
5.5.290.0030.05317.91
5.5.280.0100.06720.88
5.5.270.0030.05020.76
5.5.260.0070.04320.84
5.5.250.0030.08020.70
5.5.240.0130.05020.25
5.4.450.0670.05719.57
5.4.440.0870.05319.55
5.4.430.0830.06019.48
5.4.420.0700.06019.47
5.4.410.0170.05019.39
5.4.400.0830.05018.66
5.4.390.0900.06718.74
5.4.380.0800.05718.47
5.4.370.0730.06018.70
5.4.360.0970.04718.63
5.4.350.0900.05718.72
5.4.340.0870.05718.48
5.4.320.0800.07018.46
5.4.310.0970.06318.50
5.4.300.0870.05718.71
5.4.290.1100.06018.61
5.4.280.0800.07018.71
5.4.270.0930.04718.63
5.4.260.0930.04718.71
5.4.250.0870.05318.69
5.4.240.0900.08018.63
5.4.230.0970.05718.48
5.4.220.0800.06318.68
5.4.210.0830.05018.77
5.4.200.0900.04716.75
5.4.190.0730.05718.45
5.4.180.0830.06318.54
5.4.170.1030.06318.69
5.4.160.0800.05018.63
5.4.150.0130.05018.47
5.4.140.0100.05316.32
5.4.130.0170.04016.12
5.4.120.0470.05716.17
5.4.110.0930.06016.14
5.4.100.1000.05016.41
5.4.90.0800.05016.19
5.4.80.1000.05016.27
5.4.70.1000.04316.20
5.4.60.0900.05016.19
5.4.50.1000.04316.28
5.4.40.0830.05716.29
5.4.30.0870.05316.27
5.4.20.0800.06316.13
5.4.10.0900.05016.26
5.4.00.0930.05015.62
5.3.290.0870.06014.60
5.3.280.0730.06314.59
5.3.270.0800.05314.68
5.3.260.0800.05314.67
5.3.250.0930.04714.52
5.3.240.1030.06314.57
5.3.230.0800.06014.51
5.3.220.0830.05714.48
5.3.210.0970.05014.72
5.3.200.1000.04314.62
5.3.190.0930.04714.72
5.3.180.0830.05714.72
5.3.170.0900.05014.52
5.3.160.0870.05014.52
5.3.150.1000.04314.61
5.3.140.0900.04714.46
5.3.130.0930.04314.48
5.3.120.1030.06014.46
5.3.110.0930.05014.64
5.3.100.0900.04713.97
5.3.90.0900.04713.93
5.3.80.0770.05714.00
5.3.70.0800.05013.95
5.3.60.0830.05313.99
5.3.50.0800.05714.03
5.3.40.0830.06013.95
5.3.30.0800.05713.90
5.3.20.0900.04713.73
5.3.10.0700.05313.64
5.3.00.0730.05313.62
5.2.170.0630.04011.17
5.2.160.0800.04711.18
5.2.150.0730.05011.13
5.2.140.0730.04011.13
5.2.130.0700.04011.05
5.2.120.0600.04311.14
5.2.110.0670.03711.09
5.2.100.0670.04011.32
5.2.90.0570.04310.98
5.2.80.0700.04011.14
5.2.70.0770.04311.16
5.2.60.0630.05011.07
5.2.50.0770.04311.00
5.2.40.0700.03711.06
5.2.30.0600.04011.00
5.2.20.0600.04011.02
5.2.10.0630.03310.86
5.2.00.0600.04310.73
5.1.60.0530.03710.13
5.1.50.0700.04310.00
5.1.40.0730.04310.05
5.1.30.0770.04310.43
5.1.20.0570.03310.37
5.1.10.0500.03310.19
5.1.00.0530.03310.20
5.0.50.0300.0308.64
5.0.40.0300.0238.44
5.0.30.0270.0438.21
5.0.20.0400.0278.24
5.0.10.0270.0278.36
5.0.00.0270.0438.21
4.4.90.0030.0235.98
4.4.80.0070.0175.89
4.4.70.0030.0275.93
4.4.60.0070.0205.93
4.4.50.0000.0275.92
4.4.40.0000.0375.91
4.4.30.0000.0275.88
4.4.20.0000.0336.00
4.4.10.0100.0175.98
4.4.00.0000.0375.96
4.3.110.0200.0235.87
4.3.100.0230.0275.80
4.3.90.0200.0305.88
4.3.80.0330.0305.80
4.3.70.0270.0335.80
4.3.60.0270.0235.80
4.3.50.0230.0275.79
4.3.40.0300.0335.89
4.3.30.0100.0274.70
4.3.20.0130.0234.55
4.3.10.0170.0204.51
4.3.00.0130.0277.31

preferences:
32.46 ms | 400 KiB | 5 Q