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 "NEW " . $newstring . PHP_EOL; echo "ORIG " . $oringialString . PHP_EOL;

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.0110.00419.00
8.3.30.0040.01119.18
8.3.20.0070.00020.00
8.3.10.0040.00421.79
8.3.00.0100.00319.21
8.2.170.0150.00022.96
8.2.160.0060.00920.44
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.79
8.2.110.0060.00322.38
8.2.100.0040.00717.88
8.2.90.0060.00319.36
8.2.80.0030.00517.97
8.2.70.0090.00017.88
8.2.60.0040.00418.05
8.2.50.0030.00618.07
8.2.40.0090.00018.32
8.2.30.0000.00918.25
8.2.20.0040.00418.11
8.2.10.0080.00018.15
8.2.00.0000.00817.97
8.1.270.0100.00020.73
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0070.00324.01
8.1.230.0040.00719.01
8.1.220.0060.00317.74
8.1.210.0050.00318.77
8.1.200.0070.00317.48
8.1.190.0040.00417.48
8.1.180.0000.00818.10
8.1.170.0000.00920.50
8.1.160.0040.00422.02
8.1.150.0000.00819.03
8.1.140.0040.00417.51
8.1.130.0040.00417.74
8.1.120.0040.00417.65
8.1.110.0050.00217.53
8.1.100.0000.00817.61
8.1.90.0040.00417.59
8.1.80.0050.00317.56
8.1.70.0030.00317.64
8.1.60.0040.00417.81
8.1.50.0030.00517.59
8.1.40.0040.00417.66
8.1.30.0000.00817.88
8.1.20.0080.00017.73
8.1.10.0090.00017.76
8.1.00.0030.00617.63
8.0.300.0000.00718.77
8.0.290.0000.00717.00
8.0.280.0000.00818.39
8.0.270.0040.00417.30
8.0.260.0060.00018.41
8.0.250.0070.00017.19
8.0.240.0030.00317.10
8.0.230.0040.00417.03
8.0.220.0030.00317.09
8.0.210.0040.00417.07
8.0.200.0030.00317.10
8.0.190.0040.00417.22
8.0.180.0000.00817.19
8.0.170.0050.00317.07
8.0.160.0040.00317.12
8.0.150.0000.00716.98
8.0.140.0050.00317.00
8.0.130.0000.00613.51
8.0.120.0040.00416.98
8.0.110.0040.00417.05
8.0.100.0040.00417.18
8.0.90.0000.00716.90
8.0.80.0080.00817.16
8.0.70.0040.00417.19
8.0.60.0030.00617.15
8.0.50.0030.00617.02
8.0.30.0080.01317.26
8.0.20.0150.00717.48
8.0.10.0040.00417.27
8.0.00.0060.01116.95
7.4.330.0050.00015.23
7.4.320.0030.00316.83
7.4.300.0000.00616.71
7.4.290.0110.00016.73
7.4.280.0000.00816.75
7.4.270.0040.00416.76
7.4.260.0070.00416.86
7.4.250.0040.00416.82
7.4.240.0020.00616.78
7.4.230.0030.00316.77
7.4.220.0150.01416.84
7.4.210.0090.00616.86
7.4.200.0000.00716.71
7.4.160.0030.01316.67
7.4.150.0090.00917.40
7.4.140.0090.01117.86
7.4.130.0120.00716.66
7.4.120.0080.00916.81
7.4.110.0070.01016.68
7.4.100.0160.00316.67
7.4.90.0060.01216.62
7.4.80.0040.01519.39
7.4.70.0130.00316.76
7.4.60.0090.00816.77
7.4.50.0000.00616.71
7.4.40.0070.00916.51
7.4.30.0130.00616.88
7.4.10.0060.00915.29
7.4.00.0040.01015.09
7.3.330.0030.00313.38
7.3.320.0160.00013.31
7.3.310.0000.00716.60
7.3.300.0070.00016.58
7.3.290.0000.00716.56
7.3.280.0090.00916.55
7.3.270.0150.00317.40
7.3.260.0060.01216.54
7.3.250.0130.00616.68
7.3.240.0070.01316.68
7.3.230.0160.00816.54
7.3.210.0060.01016.68
7.3.200.0090.00919.39
7.3.190.0030.01916.65
7.3.180.0060.01016.57
7.3.170.0060.01116.77
7.3.160.0120.00616.60
7.3.130.0100.00614.80
7.3.120.0070.01115.13
7.3.110.0060.01215.32
7.3.100.0090.00615.09
7.3.90.0120.00415.04
7.3.80.0080.00315.00
7.3.70.0030.00915.04
7.3.60.0120.00315.09
7.3.50.0060.00615.03
7.3.40.0080.00415.11
7.3.30.0000.01415.13
7.3.20.0040.01116.63
7.3.10.0060.01116.76
7.3.00.0110.00616.75
7.2.330.0080.01216.81
7.2.320.0170.00016.81
7.2.310.0000.01916.98
7.2.300.0100.01316.88
7.2.290.0100.01316.77
7.2.260.0040.01515.13
7.2.250.0070.01015.02
7.2.240.0130.00315.06
7.2.230.0040.01415.44
7.2.220.0060.00615.27
7.2.210.0040.01115.06
7.2.200.0080.00315.26
7.2.190.0100.00315.38
7.2.180.0060.00315.09
7.2.170.0030.00715.29
7.2.160.0030.01715.36
7.2.150.0100.01017.09
7.2.140.0080.00417.31
7.2.130.0110.00616.88
7.2.120.0110.00917.00
7.2.110.0100.01017.19
7.2.100.0090.00716.94
7.2.90.0050.01016.91
7.2.80.0080.01016.97
7.2.70.0090.00716.92
7.2.60.0110.00316.91
7.2.50.0100.01017.02
7.2.40.0060.01216.99
7.2.30.0110.00316.99
7.2.20.0040.01416.97
7.2.10.0080.01016.86
7.2.00.0040.00917.99
7.1.330.0040.01116.28
7.1.320.0090.00015.92
7.1.310.0030.00616.24
7.1.300.0030.01315.97
7.1.290.0120.00316.12
7.1.280.0000.00916.21
7.1.270.0070.01015.99
7.1.260.0080.00415.94
7.1.250.0110.00515.96
7.1.240.0070.01015.78
7.1.230.0040.01115.92
7.1.220.0000.01415.92
7.1.210.0110.00316.21
7.1.200.0040.00815.84
7.1.190.0040.00815.93
7.1.180.0030.01016.01
7.1.170.0110.00716.15
7.1.160.0070.00716.07
7.1.150.0060.00816.15
7.1.140.0030.00615.83
7.1.130.0030.00616.14
7.1.120.0030.00615.71
7.1.110.0040.00416.07
7.1.100.0050.00617.38
7.1.90.0030.01215.93
7.1.80.0000.00915.99
7.1.70.0070.00516.51
7.1.60.0090.00817.82
7.1.50.0020.01816.37
7.1.40.0070.00316.07
7.1.30.0100.00715.81
7.1.20.0030.00716.14
7.1.10.0050.00515.98
7.1.00.0020.04419.13
7.0.330.0080.00415.30
7.0.320.0060.00615.54
7.0.310.0060.00615.58
7.0.300.0040.01115.73
7.0.290.0000.01315.55
7.0.280.0030.00915.84
7.0.270.0070.00715.67
7.0.260.0060.00615.69
7.0.250.0060.00615.63
7.0.240.0060.00915.36
7.0.230.0090.00015.54
7.0.220.0040.01115.66
7.0.210.0040.01115.75
7.0.200.0060.00616.33
7.0.190.0100.00015.69
7.0.180.0030.01015.70
7.0.170.0070.00715.59
7.0.160.0040.00715.80
7.0.150.0100.00715.28
7.0.140.0070.03718.82
7.0.130.0060.00315.78
7.0.120.0090.00615.75
7.0.110.0080.00415.63
7.0.100.0070.01015.55
7.0.90.0000.01115.71
7.0.80.0030.01015.66
7.0.70.2220.02417.69
7.0.60.0070.04517.73
7.0.50.0060.04316.75
7.0.40.0100.04117.14
7.0.30.0130.04616.98
7.0.20.0150.02416.92
7.0.10.0120.02517.02
7.0.00.0070.04716.77
5.6.400.0100.00714.23
5.6.390.0060.00614.45
5.6.380.0060.01014.54
5.6.370.0060.00614.91
5.6.360.0030.00614.19
5.6.350.0040.00714.59
5.6.340.0060.00914.81
5.6.330.0130.00014.70
5.6.320.0080.00814.69
5.6.310.0000.01414.80
5.6.300.0100.00714.35
5.6.290.0030.00914.49
5.6.280.0110.03517.76
5.6.270.0000.01714.50
5.6.260.0060.00914.15
5.6.250.0100.00314.76
5.6.240.0110.00314.52
5.6.230.0120.00314.55
5.6.220.0090.00614.47
5.6.210.0100.04217.47
5.6.200.0080.02316.33
5.6.190.0040.04917.56
5.6.180.0200.03517.50
5.6.170.0260.03817.31
5.6.160.0080.04317.42
5.6.150.0050.02316.43
5.6.140.0060.03316.33
5.6.130.0110.03316.33
5.6.120.0030.02517.80
5.6.110.0140.04017.88
5.6.100.0170.03917.86
5.6.90.0100.04417.72
5.6.80.0010.02317.34
5.6.70.0110.02117.55
5.6.60.0100.00314.34
5.6.50.0030.00914.64
5.6.40.0040.00814.50
5.6.30.0060.01214.25
5.6.20.0070.00714.29
5.6.10.0070.00714.24
5.6.00.0070.00714.34
5.5.380.0070.00714.38
5.5.370.0090.00314.61
5.5.360.0070.01114.14
5.5.350.0130.03517.41
5.5.340.0030.03016.14
5.5.330.0100.03817.33
5.5.320.0100.04017.34
5.5.310.0170.04417.43
5.5.300.0070.04216.34
5.5.290.0020.04916.16
5.5.280.0090.03417.74
5.5.270.0080.04417.43
5.5.260.0060.03117.79
5.5.250.0070.02217.63
5.5.240.0100.04117.30
5.5.230.0090.00614.60
5.5.220.0060.00614.41
5.5.210.0110.00414.25
5.5.200.0000.01414.45
5.5.190.0070.01014.47
5.5.180.0100.00314.29
5.5.170.0030.00914.51
5.5.160.0070.00714.30
5.5.150.0030.01014.58
5.5.140.0030.00714.42
5.5.130.0040.01514.53
5.5.120.0030.00614.24
5.5.110.0060.00914.37
5.5.100.0100.00314.22
5.5.90.0100.00614.50
5.5.80.0070.00714.46
5.5.70.0030.01214.44
5.5.60.0110.00314.22
5.5.50.0100.00314.20
5.5.40.0040.01114.51
5.5.30.0140.00014.26
5.5.20.0130.00314.02
5.5.10.0030.00614.44
5.5.00.0060.00614.68
5.4.450.0390.03614.97
5.4.440.0310.02815.28
5.4.430.0470.03215.17
5.4.420.0420.03415.29
5.4.410.0500.02514.96
5.4.400.0130.03114.88
5.4.390.0150.03914.82
5.4.380.0170.04014.91
5.4.370.0180.03314.91
5.4.360.0160.04114.90
5.4.350.0150.04115.03
5.4.340.0150.03914.88
5.4.330.0000.01111.39
5.4.320.0080.05014.95
5.4.310.0150.04114.82
5.4.300.0100.03914.70
5.4.290.0120.03314.63
5.4.280.0190.03714.84
5.4.270.0130.03914.82
5.4.260.0130.03814.63
5.4.250.0160.03814.62
5.4.240.0100.04314.68
5.4.230.0100.04814.85
5.4.220.0170.03814.86
5.4.210.0170.02714.92
5.4.200.0070.03313.78
5.4.190.0150.03214.91
5.4.180.0160.02614.91
5.4.170.0220.03014.77
5.4.160.0150.03615.00
5.4.150.0110.03114.93
5.4.140.0130.02513.71
5.4.130.0120.02713.63
5.4.120.0120.03213.80
5.4.110.0090.03513.60
5.4.100.0150.03113.39
5.4.90.0090.03013.67
5.4.80.0170.02413.51
5.4.70.0100.03213.52
5.4.60.0140.02713.69
5.4.50.0100.03113.65
5.4.40.0110.03813.61
5.4.30.0120.03613.60
5.4.20.0120.03813.57
5.4.10.0120.03713.66
5.4.00.0220.02513.11
5.3.290.0230.06714.65
5.3.280.0330.05314.51
5.3.270.0370.05014.56
5.3.260.0100.06314.60
5.3.250.0230.04714.68
5.3.240.0130.06014.66
5.3.230.0130.06314.58
5.3.220.0230.05314.57
5.3.210.0230.05314.64
5.3.200.0200.05314.55
5.3.190.0070.06314.55
5.3.180.0130.05714.50
5.3.170.0170.05314.72
5.3.160.0100.06014.56
5.3.150.0130.05314.56
5.3.140.0170.06714.61
5.3.130.0170.05314.46
5.3.120.0330.04014.46
5.3.110.0170.06314.48
5.3.100.0270.05014.00
5.3.90.0230.06014.12
5.3.80.0200.05314.18
5.3.70.0270.04313.95
5.3.60.0200.06713.97
5.3.50.0200.06713.96
5.3.40.0170.05713.88
5.3.30.0270.05314.02
5.3.20.0170.07013.61
5.3.10.0130.05713.81
5.3.00.0270.04713.63
5.2.170.0130.04711.18
5.2.160.0170.03711.18
5.2.150.0070.04711.37
5.2.140.0170.05011.19
5.2.130.0100.04311.16
5.2.120.0030.05311.03
5.2.110.0230.03311.04
5.2.100.0170.04011.17
5.2.90.0230.03011.04
5.2.80.0200.05311.07
5.2.70.0170.04711.07
5.2.60.0070.05011.05
5.2.50.0070.05311.00
5.2.40.0030.05010.99
5.2.30.0170.05310.97
5.2.20.0130.05311.01
5.2.10.0200.04710.88
5.2.00.0130.06010.78
5.1.60.0200.03010.06
5.1.50.0130.0409.97
5.1.40.0070.04010.01
5.1.30.0100.05010.33
5.1.20.0200.04310.37
5.1.10.0100.04010.14
5.1.00.0200.04310.12
5.0.50.0070.0338.58
5.0.40.0070.0308.50
5.0.30.0100.0438.35
5.0.20.0100.0238.31
5.0.10.0070.0308.21
5.0.00.0070.0538.20
4.4.90.0030.0275.94
4.4.80.0030.0305.94
4.4.70.0000.0375.88
4.4.60.0100.0275.89
4.4.50.0100.0275.89
4.4.40.0070.0475.84
4.4.30.0130.0205.93
4.4.20.0030.0335.93
4.4.10.0000.0375.99
4.4.00.0070.0435.87
4.3.110.0070.0305.81
4.3.100.0030.0235.76
4.3.90.0100.0235.80
4.3.80.0070.0375.89
4.3.70.0070.0205.91
4.3.60.0130.0175.80
4.3.50.0130.0235.79
4.3.40.0070.0405.89
4.3.30.0030.0304.60
4.3.20.0070.0204.68
4.3.10.0070.0274.59
4.3.00.0130.0277.31

preferences:
38.87 ms | 400 KiB | 5 Q