3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '100% Pure Body Butters French Lavender 3.4 fl. Oz'; $replacements = array( 'oz' => '', ' Oz' => '', ); $delimiter = '/'; $words = array_keys( $replacements); $regex = $delimiter . '\b(' . implode('|', array_map( 'preg_quote', $words, array_fill( 0, count( $words), $delimiter))) . ')\b' . $delimiter; $result = preg_replace_callback( $regex, function( $match) use( $replacements) { return $replacements[$match[1]]; }, $string); echo $result;

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.70.0060.01016.75
8.3.60.0070.00716.73
8.3.50.0150.00722.05
8.3.40.0140.00019.06
8.3.30.0080.00618.85
8.3.20.0050.00320.38
8.3.10.0000.00823.57
8.3.00.0000.00819.14
8.2.180.0070.01116.38
8.2.170.0150.00022.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00419.61
8.2.110.0060.00320.47
8.2.100.0030.00917.91
8.2.90.0080.00019.22
8.2.80.0080.00017.97
8.2.70.0050.00317.75
8.2.60.0060.00317.80
8.2.50.0060.00318.07
8.2.40.0030.00620.01
8.2.30.0030.00518.33
8.2.20.0040.00417.94
8.2.10.0040.00418.04
8.2.00.0050.00319.78
8.1.280.0110.00325.92
8.1.270.0060.00323.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.97
8.1.230.0070.00417.64
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0000.00917.48
8.1.190.0060.00317.35
8.1.180.0070.00018.10
8.1.170.0030.00518.75
8.1.160.0060.00321.95
8.1.150.0000.00718.79
8.1.140.0040.00417.61
8.1.130.0040.00417.78
8.1.120.0000.00817.64
8.1.110.0040.00417.65
8.1.100.0000.00717.52
8.1.90.0000.00717.63
8.1.80.0000.00817.53
8.1.70.0000.00717.59
8.1.60.0000.00817.70
8.1.50.0000.00817.67
8.1.40.0040.00417.57
8.1.30.0030.00617.71
8.1.20.0000.00817.73
8.1.10.0000.00717.71
8.1.00.0030.00517.46
8.0.300.0000.00818.77
8.0.290.0000.00816.88
8.0.280.0020.00518.43
8.0.270.0070.00017.22
8.0.260.0000.00617.29
8.0.250.0030.00317.10
8.0.240.0000.00716.94
8.0.230.0030.00317.14
8.0.220.0030.00317.09
8.0.210.0000.00717.05
8.0.200.0030.00317.09
8.0.190.0040.00417.01
8.0.180.0030.00517.04
8.0.170.0060.00316.97
8.0.160.0030.00416.91
8.0.150.0040.00416.92
8.0.140.0050.00317.04
8.0.130.0050.00013.46
8.0.120.0030.00516.92
8.0.110.0040.00416.96
8.0.100.0000.00817.15
8.0.90.0000.00716.93
8.0.80.0050.01017.03
8.0.70.0050.00317.05
8.0.60.0000.00716.82
8.0.50.0070.00016.99
8.0.30.0120.01117.18
8.0.20.0130.01017.46
8.0.10.0040.00417.00
8.0.00.0070.01116.86
7.4.330.0020.00215.04
7.4.320.0000.00816.86
7.4.300.0030.00316.75
7.4.290.0000.00616.63
7.4.280.0000.00816.81
7.4.270.0050.00316.71
7.4.260.0000.00716.66
7.4.250.0020.00516.77
7.4.240.0000.00716.75
7.4.230.0000.00716.92
7.4.220.0070.01016.73
7.4.210.0090.00616.77
7.4.200.0030.00316.88
7.4.160.0070.00916.72
7.4.150.0060.01917.40
7.4.140.0080.00817.86
7.4.130.0080.01516.63
7.4.120.0100.01016.72
7.4.110.0070.01016.80
7.4.100.0090.00916.68
7.4.90.0080.00816.85
7.4.80.0120.00619.39
7.4.70.0030.01416.56
7.4.60.0100.00716.77
7.4.50.0050.00016.40
7.4.40.0060.01116.55
7.4.30.0100.00616.63
7.4.00.0060.00915.30
7.3.330.0030.00313.52
7.3.320.0030.00313.38
7.3.310.0030.00316.27
7.3.300.0060.00016.50
7.3.290.0120.00316.43
7.3.280.0120.00616.47
7.3.270.0150.00817.40
7.3.260.0070.01016.69
7.3.250.0150.00616.60
7.3.240.0140.00416.52
7.3.230.0090.00616.73
7.3.210.0130.00316.73
7.3.200.0090.01219.39
7.3.190.0100.01316.79
7.3.180.0060.00916.32
7.3.170.0110.00616.45
7.3.160.0100.00616.66
7.3.120.0050.00815.03
7.3.10.0030.01016.72
7.3.00.0030.01016.54
7.2.330.0030.01316.88
7.2.320.0080.01516.87
7.2.310.0060.00916.87
7.2.300.0110.00616.88
7.2.290.0080.00816.89
7.2.130.0070.01016.91
7.2.120.0070.00717.02
7.2.110.0080.00417.29
7.2.100.0040.01116.88
7.2.90.0040.01116.83
7.2.80.0100.00317.08
7.2.70.0030.00917.20
7.2.60.0000.01617.16
7.2.50.0030.01517.25
7.2.40.0080.00817.13
7.2.30.0040.01216.89
7.2.20.0030.01016.91
7.2.10.0040.01217.20
7.2.00.0070.00718.30
7.1.250.0040.00415.86
7.1.100.0170.00318.55
7.1.70.0000.00917.16
7.1.60.0100.01319.70
7.1.50.0040.00717.05
7.1.00.0000.07322.37
7.0.200.0000.01017.07
7.0.140.0100.06721.91
7.0.70.0030.05321.93
7.0.60.0000.06021.77
7.0.50.0070.05721.96
7.0.40.0000.09020.14
7.0.30.0030.05020.04
7.0.20.0100.08020.05
7.0.10.0030.08720.16
7.0.00.0000.09319.93
5.6.280.0030.07321.13
5.6.220.0070.08720.53
5.6.210.0000.08720.75
5.6.200.0000.06021.00
5.6.190.0100.08021.07
5.6.180.0070.08720.95
5.6.170.0070.08720.96
5.6.160.0070.06021.11
5.6.150.0100.06721.02
5.6.140.0030.08021.01
5.6.130.0070.04321.10
5.6.120.0070.08021.06
5.6.110.0100.07021.04
5.6.100.0100.07321.16
5.6.90.0000.04321.00
5.6.80.0030.08320.34
5.6.70.0030.04720.48
5.6.60.0070.07320.45
5.6.50.0130.04720.40
5.6.40.0030.05720.39
5.6.30.0070.07020.38
5.6.20.0000.08720.40
5.6.10.0000.08320.32
5.6.00.0130.05720.43
5.5.360.0030.07720.40
5.5.350.0070.07020.39
5.5.340.0070.07720.74
5.5.330.0070.07720.89
5.5.320.0030.08720.65
5.5.310.0070.06020.83
5.5.300.0070.07320.77
5.5.290.0030.08720.89
5.5.280.0100.07720.83
5.5.270.0100.06320.86
5.5.260.0030.08020.87
5.5.250.0100.04320.71
5.5.240.0070.05020.31
5.5.230.0100.05320.33
5.5.220.0000.08720.29
5.5.210.0030.07320.14
5.5.200.0000.04720.23
5.5.190.0000.06720.18
5.5.180.0170.06720.24
5.5.160.0030.08320.22
5.5.150.0030.06320.22
5.5.140.0000.06720.22
5.5.130.0030.06020.24
5.5.120.0030.08320.24
5.5.110.0070.06320.12
5.5.100.0100.07720.14
5.5.90.0000.08319.98
5.5.80.0030.07720.05
5.5.70.0070.07720.15
5.5.60.0030.07320.11
5.5.50.0070.07319.96
5.5.40.0070.04720.00
5.5.30.0000.08320.16
5.5.20.0070.06020.15
5.5.10.0070.06020.03
5.5.00.0000.08720.11
5.4.450.0100.07719.48
5.4.440.0000.08019.48
5.4.430.0030.07319.37
5.4.420.0030.07719.35
5.4.410.0030.06319.07
5.4.400.0030.07719.21
5.4.390.0070.07718.88
5.4.380.0070.05718.88
5.4.370.0030.07319.14
5.4.360.0000.08318.88
5.4.350.0030.05318.91
5.4.340.0070.07718.88
5.4.320.0070.07019.21
5.4.310.0030.08019.16
5.4.300.0030.07019.12
5.4.290.0070.06719.05
5.4.280.0100.07019.15
5.4.270.0000.07719.03
5.4.260.0070.04718.87
5.4.250.0030.07719.12
5.4.240.0070.07019.04
5.4.230.0070.06319.13
5.4.220.0000.07719.11
5.4.210.0100.07319.03
5.4.200.0100.07019.08
5.4.190.0030.07718.86
5.4.180.0100.07319.02
5.4.170.0100.07318.83
5.4.160.0030.08018.92
5.4.150.0070.04319.10
5.4.140.0000.05016.43
5.4.130.0000.05716.18
5.4.120.0030.07716.45
5.4.110.0000.06716.51
5.4.100.0070.04316.43
5.4.90.0100.06716.41
5.4.80.0000.04016.45
5.4.70.0070.05016.48
5.4.60.0030.06016.42
5.4.50.0000.07316.25
5.4.40.0100.07016.49
5.4.30.0070.05016.40
5.4.20.0070.07016.47
5.4.10.0000.05016.32
5.4.00.0030.06315.86
5.3.290.0000.07314.68
5.3.280.0030.07714.54
5.3.270.0100.07314.71
5.3.260.0030.08014.53
5.3.250.0100.07014.61
5.3.240.0000.04014.66
5.3.230.0000.04314.74
5.3.220.0030.07314.55
5.3.210.0000.08314.62
5.3.200.0000.08014.70
5.3.190.0070.08014.68
5.3.180.0070.06314.55
5.3.170.0070.05714.57
5.3.160.0030.04314.50
5.3.150.0030.05314.58
5.3.140.0030.06714.57
5.3.130.0000.05314.50
5.3.120.0000.07314.55
5.3.110.0030.07714.64
5.3.100.0100.07014.17
5.3.90.0000.07714.06
5.3.80.0030.07314.09
5.3.70.0000.07714.11
5.3.60.0070.06713.88
5.3.50.0000.06314.05
5.3.40.0000.07313.88
5.3.30.0030.07013.95
5.3.20.0070.05313.59
5.3.10.0070.07313.71
5.3.00.0070.07313.66
5.2.170.0030.05712.22
5.2.160.0000.06312.22
5.2.150.0100.04312.22
5.2.140.0070.06312.22
5.2.130.0000.03712.22
5.2.120.0000.06312.22
5.2.110.0070.05312.22
5.2.100.0030.06012.22
5.2.90.0000.06312.22
5.2.80.0070.06012.22
5.2.70.0000.03012.22
5.2.60.0070.06012.22
5.2.50.0030.05312.22
5.2.40.0000.06312.22
5.2.30.0000.06312.22
5.2.20.0030.04712.22
5.2.10.0000.04312.22
5.2.00.0100.06012.22
5.1.60.0000.05712.22
5.1.50.0030.05312.22
5.1.40.0030.04012.22
5.1.30.0000.04012.22
5.1.20.0000.03012.22
5.1.10.0000.02712.22
5.1.00.0000.04012.22
5.0.50.0000.02012.22
5.0.40.0030.01712.22
5.0.30.0000.03312.22
5.0.20.0000.02712.22
5.0.10.0000.04012.22
5.0.00.0000.03312.22
4.4.90.0000.03712.22
4.4.80.0100.02712.22
4.4.70.0000.03012.22
4.4.60.0030.02312.22
4.4.50.0030.02712.22
4.4.40.0030.06012.22
4.4.30.0030.03312.22
4.4.20.0000.01712.22
4.4.10.0030.02012.22
4.4.00.0000.02312.22
4.3.110.0000.01712.22
4.3.100.0030.01312.22
4.3.90.0000.01312.22
4.3.80.0000.02312.22
4.3.70.0000.02012.22
4.3.60.0000.03712.22
4.3.50.0000.03312.22
4.3.40.0000.03012.22
4.3.30.0000.01712.22
4.3.20.0000.01712.22
4.3.10.0030.03012.22
4.3.00.0000.01712.22

preferences:
35.31 ms | 401 KiB | 5 Q