3v4l.org

run code in 300+ PHP versions simultaneously
<?php $searchTerm = "abcd"; $replaceTerm = "XXXX"; $test=array("$searchTerm/$searchTerm_.mp3", "$searchTerm", "xay$searchTerm", "asdasd/$searchTerm.mp3", "$searchTerm.", "blahahbasd$searchTerm"); foreach ($test as $t) echo "$t => " . preg_replace("/(". preg_quote($searchTerm) . "([^_.])|". preg_quote($searchTerm) . "$)/x", preg_quote($replaceTerm) . "\${2}", $t) . "\n";

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.0150.00416.63
8.3.60.0100.00716.63
8.3.50.0080.01022.07
8.3.40.0100.01019.27
8.3.30.0030.01019.04
8.3.20.0040.00420.16
8.3.10.0050.00323.48
8.3.00.0060.00320.77
8.2.180.0070.01116.98
8.2.170.0070.00722.96
8.2.160.0040.01120.48
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0080.00021.00
8.2.110.0060.00322.26
8.2.100.0080.00318.05
8.2.90.0080.00019.23
8.2.80.0000.00817.97
8.2.70.0040.00417.88
8.2.60.0030.00518.04
8.2.50.0050.00318.07
8.2.40.0040.00418.16
8.2.30.0050.00218.15
8.2.20.0000.00717.80
8.2.10.0040.00418.21
8.2.00.0040.00417.94
8.1.280.0140.00025.92
8.1.270.0000.00823.71
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0090.00023.86
8.1.230.0040.00719.16
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0000.00817.38
8.1.180.0080.00018.10
8.1.170.0030.00518.68
8.1.160.0040.00421.95
8.1.150.0000.00718.70
8.1.140.0040.00417.52
8.1.130.0000.00717.91
8.1.120.0030.00517.61
8.1.110.0040.00417.65
8.1.100.0000.00717.63
8.1.90.0080.00017.50
8.1.80.0040.00417.53
8.1.70.0030.00317.41
8.1.60.0060.00317.80
8.1.50.0040.00417.60
8.1.40.0000.00817.53
8.1.30.0030.00617.60
8.1.20.0030.00517.83
8.1.10.0070.00017.58
8.1.00.0030.00617.64
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0070.00018.47
8.0.270.0040.00417.32
8.0.260.0030.00317.27
8.0.250.0000.00717.14
8.0.240.0000.00817.06
8.0.230.0040.00417.07
8.0.220.0070.00017.02
8.0.210.0040.00417.11
8.0.200.0030.00617.04
8.0.190.0040.00417.11
8.0.180.0000.00817.10
8.0.170.0080.00017.03
8.0.160.0030.00517.00
8.0.150.0050.00217.05
8.0.140.0040.00417.10
8.0.130.0050.00013.54
8.0.120.0040.00417.05
8.0.110.0030.00516.93
8.0.100.0040.00417.07
8.0.90.0000.00716.91
8.0.80.0000.01517.06
8.0.70.0040.00417.14
8.0.60.0070.00017.09
8.0.50.0040.00416.98
8.0.30.0120.00717.30
8.0.20.0060.01317.47
8.0.10.0050.00217.13
8.0.00.0050.01316.97
7.4.330.0020.00215.11
7.4.320.0030.00316.84
7.4.300.0030.00316.82
7.4.290.0000.00716.73
7.4.280.0050.00516.70
7.4.270.0000.00716.87
7.4.260.0000.00716.56
7.4.250.0030.00316.64
7.4.240.0030.00316.69
7.4.230.0020.00516.70
7.4.220.0070.01116.76
7.4.210.0170.00316.93
7.4.200.0030.00316.70
7.4.160.0100.00616.65
7.4.150.0110.00617.40
7.4.140.0040.01417.86
7.4.130.0100.00616.89
7.4.120.0080.00916.66
7.4.110.0030.01416.67
7.4.100.0120.00616.58
7.4.90.0090.00916.55
7.4.80.0060.01319.39
7.4.70.0100.01116.57
7.4.60.0100.01016.70
7.4.50.0000.00516.69
7.4.40.0090.00916.83
7.4.30.0060.01316.82
7.4.00.0070.01115.14
7.3.330.0000.00613.28
7.3.320.0020.00213.34
7.3.310.0000.00816.46
7.3.300.0000.00716.53
7.3.290.0160.00316.57
7.3.280.0100.00816.50
7.3.270.0130.00617.40
7.3.260.0100.00616.73
7.3.250.0110.00916.59
7.3.240.0090.00916.58
7.3.230.0130.00916.39
7.3.210.0100.01016.52
7.3.200.0030.01519.39
7.3.190.0130.01016.65
7.3.180.0110.00716.86
7.3.170.0120.00316.44
7.3.160.0100.01016.63
7.3.120.0080.00915.06
7.3.110.0070.01014.74
7.3.100.0140.00015.18
7.3.90.0060.00615.05
7.3.80.0070.00715.14
7.3.70.0060.01015.06
7.3.60.0090.00614.88
7.3.50.0070.00714.88
7.3.40.0070.01115.01
7.3.30.0000.01014.64
7.3.20.0070.01016.83
7.3.10.0070.00716.78
7.3.00.0100.00616.88
7.2.330.0120.00616.71
7.2.320.0060.01216.65
7.2.310.0040.01416.76
7.2.300.0060.01116.88
7.2.290.0100.00716.72
7.2.250.0070.00715.23
7.2.240.0060.01015.27
7.2.230.0000.01515.13
7.2.220.0060.00915.20
7.2.210.0040.01415.11
7.2.200.0120.00314.91
7.2.190.0040.01115.04
7.2.180.0040.01115.20
7.2.170.0090.00614.79
7.2.00.0000.00919.57
7.1.330.0070.01016.05
7.1.320.0070.00416.07
7.1.310.0060.00815.90
7.1.300.0070.01116.14
7.1.290.0120.00315.92
7.1.280.0070.00715.93
7.1.270.0080.00416.09
7.1.260.0080.00415.76
7.1.100.0070.00418.26
7.1.70.0040.00417.37
7.1.60.0090.01219.70
7.1.50.0070.01717.20
7.1.00.0000.08022.46
7.0.200.0060.00616.49
7.0.140.0070.06722.12
7.0.60.0070.06320.05
7.0.50.0030.04317.90
7.0.40.0070.04320.06
7.0.30.0570.06720.03
7.0.20.0200.07320.11
7.0.10.0070.05720.21
7.0.00.0070.08020.14
5.6.280.0070.07021.10
5.6.210.0100.07320.56
5.6.200.0030.07718.10
5.6.190.0100.08320.41
5.6.180.3230.03720.67
5.6.170.0300.06720.71
5.6.160.0030.04020.54
5.6.150.0030.03718.22
5.6.140.0070.05018.16
5.6.130.0030.04318.16
5.6.120.0000.04720.98
5.6.110.0200.06320.97
5.6.100.0130.07320.98
5.6.90.0070.06021.12
5.6.80.0070.04320.37
5.6.70.3130.03720.42
5.5.350.0000.08720.43
5.5.340.0070.04017.91
5.5.330.0030.08020.15
5.5.320.0230.07720.21
5.5.310.0200.04320.13
5.5.300.0070.08017.91
5.5.290.0030.05318.00
5.5.280.0130.06720.77
5.5.270.0000.04720.79
5.5.260.0070.08720.96
5.5.250.0070.07020.56
5.5.240.0200.05020.18
5.4.450.0630.05328.28
5.4.440.0130.05028.25
5.4.430.0270.04027.24
5.4.420.0330.04326.50
5.4.410.0030.05326.15
5.4.400.0100.04326.13
5.4.390.0270.05026.13
5.4.380.0100.07018.48
5.4.370.0070.06318.58
5.4.360.0130.05018.55
5.4.350.0070.06018.73
5.4.340.0100.05318.72
5.4.320.0110.03312.46
5.4.310.0020.04312.45
5.4.300.0100.05712.45
5.4.290.0030.04312.45
5.4.280.0110.03512.35
5.4.270.0080.03912.35
5.4.260.0040.04412.35
5.4.250.0070.04012.35
5.4.240.0090.05312.35
5.4.230.0080.04612.34
5.4.220.0050.04012.34
5.4.210.0070.04212.34
5.4.200.0070.04212.34
5.4.190.0080.04712.34
5.4.180.0040.05912.34
5.4.170.0080.05212.35
5.4.160.0120.04612.35
5.4.150.0080.05112.34
5.4.140.0080.04012.03
5.4.130.0120.03612.02
5.4.120.0050.03711.97
5.4.110.0060.03511.97
5.4.100.0110.03011.96
5.4.90.0080.04111.96
5.4.80.0110.03411.96
5.4.70.0080.05111.96
5.4.60.0100.05011.96
5.4.50.0090.05311.96
5.4.40.0090.03611.95
5.4.30.0060.03611.95
5.4.20.0040.03711.95
5.4.10.0040.03711.95
5.4.00.0080.03611.44
5.3.290.0070.03912.80
5.3.280.0080.04612.71
5.3.270.0060.05712.72
5.3.260.0040.04212.72
5.3.250.0060.03812.72
5.3.240.0050.03812.72
5.3.230.0050.04112.71
5.3.220.0060.04312.68
5.3.210.0060.04312.68
5.3.200.0070.03812.68
5.3.190.0070.04712.68
5.3.180.0070.04512.67
5.3.170.0070.04112.67
5.3.160.0090.04412.68
5.3.150.0060.03912.68
5.3.140.0070.04512.66
5.3.130.0080.04612.66
5.3.120.0100.06812.66
5.3.110.0110.07012.66
5.3.100.0140.06312.12
5.3.90.0100.05512.08
5.3.80.0120.07012.07
5.3.70.0080.05212.07
5.3.60.0110.04912.07
5.3.50.0040.05312.00
5.3.40.0070.05312.00
5.3.30.0090.04111.96
5.3.20.0080.03511.73
5.3.10.0060.03511.70
5.3.00.0050.03711.69
5.2.170.0050.0349.19
5.2.160.0040.0369.20
5.2.150.0050.0439.19
5.2.140.0060.0339.19
5.2.130.0020.0429.15
5.2.120.0040.0319.15
5.2.110.0050.0339.16
5.2.100.0050.0419.16
5.2.90.0100.0389.15
5.2.80.0080.0419.15
5.2.70.0090.0459.14
5.2.60.0070.0439.10
5.2.50.0080.0439.07
5.2.40.0080.0349.05
5.2.30.0060.0489.03
5.2.20.0090.0409.02
5.2.10.0080.0408.93
5.2.00.0060.0378.79
5.1.60.0050.0338.08
5.1.50.0090.0308.07
5.1.40.0080.0338.05
5.1.30.0050.0378.41
5.1.20.0110.0528.42
5.1.10.0080.0358.15
5.1.00.0090.0368.15
5.0.50.0030.0296.63
5.0.40.0040.0266.48
5.0.30.0030.0526.30
5.0.20.0020.0246.28
5.0.10.0040.0286.25
5.0.00.0050.0356.24
4.4.90.0020.0224.78
4.4.80.0050.0224.75
4.4.70.0030.0234.76
4.4.60.0040.0214.75
4.4.50.0050.0174.77
4.4.40.0040.0284.70
4.4.30.0050.0144.76
4.4.20.0040.0194.84
4.4.10.0050.0174.85
4.4.00.0010.0324.76
4.3.110.0030.0224.67
4.3.100.0050.0164.66
4.3.90.0030.0164.64
4.3.80.0050.0244.59
4.3.70.0060.0184.63
4.3.60.0040.0214.63
4.3.50.0020.0244.63
4.3.40.0030.0264.54
4.3.30.0020.0183.30
4.3.20.0040.0173.27
4.3.10.0020.0173.23
4.3.00.0000.02026.13

preferences:
54.38 ms | 401 KiB | 5 Q