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) { 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.40.0090.00619.04
8.3.30.0070.00719.16
8.3.20.0080.00020.13
8.3.10.0040.00421.95
8.3.00.0060.00319.13
8.2.170.0070.01122.96
8.2.160.0110.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0000.00819.79
8.2.110.0070.00322.38
8.2.100.0040.00817.75
8.2.90.0040.00419.36
8.2.80.0060.00317.97
8.2.70.0050.00317.75
8.2.60.0080.00418.05
8.2.50.0050.00318.07
8.2.40.0050.00318.08
8.2.30.0050.00518.22
8.2.20.0000.00817.81
8.2.10.0060.00318.21
8.2.00.0040.00417.95
8.1.270.0000.00920.78
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.92
8.1.230.0070.00419.07
8.1.220.0050.00317.76
8.1.210.0120.00018.77
8.1.200.0080.00417.47
8.1.190.0050.00517.35
8.1.180.0050.00318.10
8.1.170.0040.00418.83
8.1.160.0070.00021.95
8.1.150.0070.00018.85
8.1.140.0020.00517.56
8.1.130.0040.00417.87
8.1.120.0030.00417.59
8.1.110.0000.00817.52
8.1.100.0040.00417.49
8.1.90.0040.00417.50
8.1.80.0040.00417.50
8.1.70.0000.00717.50
8.1.60.0060.00317.73
8.1.50.0000.00817.72
8.1.40.0040.00417.65
8.1.30.0080.00017.65
8.1.20.0050.00317.70
8.1.10.0030.00617.66
8.1.00.0030.00517.59
8.0.300.0080.00018.77
8.0.290.0000.00816.88
8.0.280.0000.00718.47
8.0.270.0070.00017.25
8.0.260.0070.00017.27
8.0.250.0070.00017.15
8.0.240.0050.00217.09
8.0.230.0040.00417.09
8.0.220.0000.00717.04
8.0.210.0040.00417.05
8.0.200.0030.00317.00
8.0.190.0060.00317.02
8.0.180.0050.00217.09
8.0.170.0000.00816.93
8.0.160.0040.00317.03
8.0.150.0000.00816.98
8.0.140.0080.00016.99
8.0.130.0060.00013.36
8.0.120.0000.00816.97
8.0.110.0050.00317.07
8.0.100.0000.00816.90
8.0.90.0000.00816.93
8.0.80.0100.00617.11
8.0.70.0020.00516.95
8.0.60.0000.00816.88
8.0.50.0080.00017.07
8.0.30.0160.00517.26
8.0.20.0150.00817.41
8.0.10.0000.00717.18
8.0.00.0110.01017.20
7.4.330.0060.00015.14
7.4.320.0000.00616.84
7.4.300.0030.00316.66
7.4.290.0030.00616.83
7.4.280.0000.00916.65
7.4.270.0030.00316.84
7.4.260.0110.00016.75
7.4.250.0040.00416.74
7.4.240.0040.00316.73
7.4.230.0040.00416.94
7.4.220.0110.00716.89
7.4.210.0050.01316.76
7.4.200.0070.00016.93
7.4.160.0060.00916.62
7.4.150.0100.00717.40
7.4.140.0140.00717.86
7.4.130.0020.01516.72
7.4.120.0110.00816.68
7.4.110.0120.00616.76
7.4.100.0060.01416.57
7.4.90.0070.01016.64
7.4.80.0070.01419.39
7.4.70.0060.01116.81
7.4.60.0060.01116.70
7.4.50.0040.00416.71
7.4.40.0050.01316.68
7.4.30.0080.01516.73
7.4.00.0080.00815.23
7.3.330.0030.00313.25
7.3.320.0080.00913.24
7.3.310.0040.00416.51
7.3.300.0040.00416.50
7.3.290.0000.00716.54
7.3.280.0060.01016.59
7.3.270.0030.01517.40
7.3.260.0030.01516.54
7.3.250.0110.00916.74
7.3.240.0030.01616.62
7.3.230.0140.00616.61
7.3.210.0100.01016.61
7.3.200.0100.01219.39
7.3.190.0090.00616.74
7.3.180.0110.00716.80
7.3.170.0060.01316.60
7.3.160.0030.01516.72
7.3.120.0070.01114.96
7.3.110.0090.00815.07
7.3.100.0060.01315.11
7.3.90.0080.00715.12
7.3.80.0090.00915.04
7.3.70.0050.00915.00
7.3.60.0090.00615.16
7.3.50.0080.00615.05
7.3.40.0080.00614.99
7.3.30.0030.00815.03
7.3.20.0040.01016.87
7.3.10.0090.00416.84
7.3.00.0060.00516.85
7.2.330.0100.01016.96
7.2.320.0100.00716.80
7.2.310.0000.02316.74
7.2.300.0050.01516.77
7.2.290.0070.01116.71
7.2.250.0060.01115.37
7.2.240.0100.00815.27
7.2.230.0060.00915.44
7.2.220.0010.01115.36
7.2.210.0060.01015.33
7.2.200.0030.01115.25
7.2.190.0030.01015.23
7.2.180.0060.00815.34
7.2.170.0050.01015.22
7.2.160.0030.01315.30
7.2.150.0000.01417.17
7.2.140.0100.00317.11
7.2.130.0090.00616.99
7.2.120.0060.01017.28
7.2.110.0090.00617.09
7.2.100.0070.00717.16
7.2.90.0030.01217.25
7.2.80.0070.01017.36
7.2.70.0060.00617.05
7.2.60.0070.00717.12
7.2.50.0130.00617.26
7.2.40.0090.00617.10
7.2.30.0060.01017.32
7.2.20.0060.01216.93
7.2.10.0090.00917.20
7.2.00.0050.00818.38
7.1.330.0070.00716.07
7.1.320.0040.00816.14
7.1.310.0060.00715.96
7.1.300.0110.00515.99
7.1.290.0070.00515.87
7.1.280.0050.00616.00
7.1.270.0080.00516.06
7.1.260.0080.00516.10
7.1.250.0090.00015.89
7.1.240.0060.00916.00
7.1.230.0030.01015.93
7.1.220.0090.00015.97
7.1.210.0000.01516.00
7.1.200.0100.00215.99
7.1.190.0030.00915.99
7.1.180.0000.01715.90
7.1.170.0100.00315.96
7.1.160.0000.01216.18
7.1.150.0100.00315.97
7.1.140.0090.00616.07
7.1.130.0060.00615.83
7.1.120.0030.01316.02
7.1.110.0090.00315.70
7.1.100.0070.00916.99
7.1.90.0060.00616.05
7.1.80.0030.00915.83
7.1.70.0050.00416.47
7.1.60.0020.01117.82
7.1.50.0040.01316.61
7.1.40.0110.00416.15
7.1.30.0100.00415.71
7.1.20.0000.01416.12
7.1.10.0060.00315.72
7.1.00.0070.04019.29
7.0.330.0060.01015.82
7.0.320.0000.01615.64
7.0.310.0000.01515.64
7.0.300.0030.01215.79
7.0.290.0000.01415.84
7.0.280.0080.00415.33
7.0.270.0070.00715.61
7.0.260.0070.01015.54
7.0.250.0000.01315.59
7.0.240.0090.00015.55
7.0.230.0000.01415.59
7.0.220.0090.00015.80
7.0.210.0030.01015.55
7.0.200.0030.00816.38
7.0.190.0040.01115.40
7.0.180.0040.01115.73
7.0.170.0070.00415.72
7.0.160.0100.00315.36
7.0.150.0030.01015.73
7.0.140.0030.02218.81
7.0.130.0040.01215.55
7.0.120.0100.00615.64
7.0.110.0090.00415.70
7.0.100.0030.00715.72
7.0.90.0100.00615.73
7.0.80.0030.00615.70
7.0.70.2050.03017.74
7.0.60.0070.04317.68
7.0.50.0100.04316.76
7.0.40.0030.04117.02
7.0.30.0160.03316.90
7.0.20.0150.03316.92
7.0.10.0100.02417.13
7.0.00.0000.05317.06
5.6.400.0040.00714.09
5.6.390.0070.00714.59
5.6.380.0100.00314.72
5.6.370.0070.00714.71
5.6.360.0070.00314.73
5.6.350.0040.01414.91
5.6.340.0030.01014.62
5.6.330.0000.01214.70
5.6.320.0040.01114.64
5.6.310.0060.01014.69
5.6.300.0030.01314.50
5.6.290.0110.00014.68
5.6.280.0080.03517.63
5.6.270.0090.00614.51
5.6.260.0040.01214.54
5.6.250.0040.01114.61
5.6.240.0060.00914.54
5.6.230.0060.00714.81
5.6.220.0130.00314.78
5.6.210.0020.02817.46
5.6.200.0050.02316.35
5.6.190.0050.03017.58
5.6.180.0240.03617.50
5.6.170.0150.03817.48
5.6.160.0030.05017.44
5.6.150.0030.02516.24
5.6.140.0110.02516.55
5.6.130.0070.02816.50
5.6.120.0030.03917.77
5.6.110.0060.04817.71
5.6.100.0070.04317.82
5.6.90.0050.04817.88
5.6.80.0040.02217.60
5.6.70.0070.02317.40
5.6.60.0070.00314.37
5.6.50.0040.01114.34
5.6.40.0140.00014.70
5.6.30.0100.00014.35
5.6.20.0030.00614.36
5.6.10.0110.00614.51
5.6.00.0070.00314.55
5.5.380.0060.00614.24
5.5.370.0060.00614.72
5.5.360.0120.00314.57
5.5.350.0090.04217.40
5.5.340.0060.02316.24
5.5.330.0030.02617.29
5.5.320.0040.04717.41
5.5.310.0170.03917.55
5.5.300.0090.04016.31
5.5.290.0040.02316.17
5.5.280.0020.03517.70
5.5.270.0060.04717.64
5.5.260.0100.02517.67
5.5.250.0070.04517.54
5.5.240.0050.04517.27
5.5.230.0060.00614.43
5.5.220.0040.00414.40
5.5.210.0000.01214.33
5.5.200.0060.00614.38
5.5.190.0060.00614.56
5.5.180.0000.01114.48
5.5.170.0060.00914.39
5.5.160.0060.00914.61
5.5.150.0080.00314.30
5.5.140.0070.00414.37
5.5.130.0090.00314.42
5.5.120.0030.01014.36
5.5.110.0080.00814.37
5.5.100.0030.01414.48
5.5.90.0030.01014.57
5.5.80.0030.01014.30
5.5.70.0130.00314.62
5.5.60.0000.01314.43
5.5.50.0090.00614.00
5.5.40.0100.00614.32
5.5.30.0040.00814.23
5.5.20.0040.00814.31
5.5.10.0060.00614.18
5.5.00.0060.00614.24
5.4.450.0350.04315.24
5.4.440.0480.03615.43
5.4.430.0600.03215.12
5.4.420.0500.03515.22
5.4.410.0310.02915.35
5.4.400.0100.03114.94
5.4.390.0140.02614.85
5.4.380.0180.02814.94
5.4.370.0120.03015.00
5.4.360.0150.02515.08
5.4.350.0080.03314.96
5.4.340.0190.02314.94
5.4.330.0090.00611.20
5.4.320.0150.02714.97
5.4.310.0120.03014.72
5.4.300.0100.03115.02
5.4.290.0120.02714.79
5.4.280.0100.03114.85
5.4.270.0190.02614.84
5.4.260.0120.02914.87
5.4.250.0120.03114.96
5.4.240.0130.02814.87
5.4.230.0150.03414.90
5.4.220.0110.03014.79
5.4.210.0090.03414.67
5.4.200.0150.03013.87
5.4.190.0200.01714.92
5.4.180.0070.03514.82
5.4.170.0100.02814.89
5.4.160.0120.03014.64
5.4.150.0170.02414.68
5.4.140.0180.03313.68
5.4.130.0070.03313.57
5.4.120.0080.02813.67
5.4.110.0070.02913.65
5.4.100.0170.02013.64
5.4.90.0080.03013.61
5.4.80.0150.03213.54
5.4.70.0110.03613.62
5.4.60.0100.02813.53
5.4.50.0110.03613.64
5.4.40.0130.02713.73
5.4.30.0130.02513.60
5.4.20.0110.02813.79
5.4.10.0100.02713.70
5.4.00.0030.03313.47
5.3.290.0170.05714.58
5.3.280.0170.05014.55
5.3.270.0200.05014.76
5.3.260.0070.06314.61
5.3.250.0070.06314.54
5.3.240.0170.06314.52
5.3.230.0070.06314.59
5.3.220.0230.05014.66
5.3.210.0170.05714.55
5.3.200.0070.06014.60
5.3.190.0170.05314.52
5.3.180.0130.05714.51
5.3.170.0200.07014.71
5.3.160.0370.05314.51
5.3.150.0230.04714.55
5.3.140.0400.04314.55
5.3.130.0400.06314.53
5.3.120.0430.07014.60
5.3.110.0230.07314.46
5.3.100.0200.06714.02
5.3.90.0430.06014.05
5.3.80.0270.06014.12
5.3.70.0300.05314.17
5.3.60.0130.07014.04
5.3.50.0270.06013.86
5.3.40.0300.06313.94
5.3.30.0130.06014.06
5.3.20.0370.07013.85
5.3.10.0230.06013.65
5.3.00.0230.07313.60
5.2.170.0300.05311.36
5.2.160.0170.05711.14
5.2.150.0300.04311.07
5.2.140.0230.05311.11
5.2.130.0100.06011.17
5.2.120.0130.06011.03
5.2.110.0200.05011.06
5.2.100.0270.05011.13
5.2.90.0370.03711.07
5.2.80.0130.04711.05
5.2.70.0130.06011.08
5.2.60.0170.05711.04
5.2.50.0270.03711.00
5.2.40.0200.04711.01
5.2.30.0070.05011.00
5.2.20.0230.05710.98
5.2.10.0130.05310.97
5.2.00.0230.04710.77
5.1.60.0230.0479.97
5.1.50.0200.0379.99
5.1.40.0130.04310.09
5.1.30.0130.04010.39
5.1.20.0170.03310.37
5.1.10.0130.05010.20
5.1.00.0200.04710.06
5.0.50.0070.0408.55
5.0.40.0100.0338.45
5.0.30.0100.0438.26
5.0.20.0130.0278.33
5.0.10.0200.0308.18
5.0.00.0170.0478.25
4.4.90.0170.0305.93
4.4.80.0200.0235.94
4.4.70.0170.0235.92
4.4.60.0070.0305.92
4.4.50.0100.0235.94
4.4.40.0100.0375.83
4.4.30.0130.0205.92
4.4.20.0100.0275.94
4.4.10.0130.0275.94
4.4.00.0130.0405.92
4.3.110.0030.0275.82
4.3.100.0130.0235.84
4.3.90.0070.0235.93
4.3.80.0070.0405.92
4.3.70.0100.0205.80
4.3.60.0170.0175.84
4.3.50.0130.0235.80
4.3.40.0070.0375.76
4.3.30.0070.0334.58
4.3.20.0100.0304.54
4.3.10.0070.0334.54
4.3.00.0100.0237.31

preferences:
53.17 ms | 400 KiB | 5 Q