3v4l.org

run code in 300+ PHP versions simultaneously
<?php $searchTerm = "abcd"; $replaceTerm = "XXXX"; $test=array("${searchTerm}/${searchTerm}_.${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.40.0110.00419.27
8.3.30.0210.00019.13
8.3.20.0070.00020.24
8.3.10.0040.00423.65
8.3.00.0040.00420.64
8.2.170.0120.00322.96
8.2.160.0130.00320.57
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.97
8.2.110.0030.00620.40
8.2.100.0080.00417.97
8.2.90.0040.00419.21
8.2.80.0030.00517.97
8.2.70.0060.00317.63
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0030.00520.07
8.2.30.0070.00018.21
8.2.20.0080.00017.71
8.2.10.0040.00418.14
8.2.00.0040.00417.96
8.1.270.0030.00623.96
8.1.260.0050.00226.35
8.1.250.0080.00028.09
8.1.240.0090.00022.02
8.1.230.0090.00317.53
8.1.220.0050.00317.78
8.1.210.0090.00018.77
8.1.200.0070.00417.48
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0000.00818.62
8.1.160.0020.00522.00
8.1.150.0000.00718.70
8.1.140.0040.00417.51
8.1.130.0000.00717.91
8.1.120.0040.00417.64
8.1.110.0040.00417.65
8.1.100.0080.00017.64
8.1.90.0000.00817.59
8.1.80.0000.00817.56
8.1.70.0030.00317.47
8.1.60.0000.00917.73
8.1.50.0000.00817.69
8.1.40.0040.00417.70
8.1.30.0050.00517.71
8.1.20.0030.00617.66
8.1.10.0000.00717.63
8.1.00.0000.01117.59
8.0.300.0050.00318.77
8.0.290.0030.00616.88
8.0.280.0030.00318.35
8.0.270.0030.00517.28
8.0.260.0030.00317.18
8.0.250.0030.00317.08
8.0.240.0090.00017.08
8.0.230.0070.00017.10
8.0.220.0000.00716.96
8.0.210.0040.00417.00
8.0.200.0060.00317.10
8.0.190.0030.00617.00
8.0.180.0080.00417.09
8.0.170.0040.00417.06
8.0.160.0040.00417.06
8.0.150.0030.00516.97
8.0.140.0040.00416.96
8.0.130.0000.00513.43
8.0.120.0040.00416.96
8.0.110.0050.00216.93
8.0.100.0040.00416.97
8.0.90.0040.00416.88
8.0.80.0030.01217.00
8.0.70.0070.00017.02
8.0.60.0040.00417.04
8.0.50.0050.00216.88
8.0.30.0120.00817.31
8.0.20.0110.00917.40
8.0.10.0040.00416.95
8.0.00.0110.00616.86
7.4.330.0020.00215.11
7.4.320.0000.00616.61
7.4.300.0030.00316.70
7.4.290.0050.00316.71
7.4.280.0040.00416.70
7.4.270.0000.00716.73
7.4.260.0000.00816.71
7.4.250.0000.00716.63
7.4.240.0030.00316.77
7.4.230.0000.00916.82
7.4.220.0060.01216.85
7.4.210.0060.00916.66
7.4.200.0000.00716.91
7.4.160.0040.01116.71
7.4.150.0140.00317.40
7.4.140.0110.01017.86
7.4.130.0120.00616.77
7.4.120.0080.00916.63
7.4.110.0140.00416.80
7.4.100.0140.00916.66
7.4.90.0100.01016.78
7.4.80.0150.00319.39
7.4.70.0110.00616.55
7.4.60.0080.00816.58
7.4.50.0040.00016.39
7.4.40.0060.01016.57
7.4.30.0030.01616.79
7.4.00.0060.01115.05
7.3.330.0000.00513.39
7.3.320.0000.00513.31
7.3.310.0000.00816.31
7.3.300.0030.00316.47
7.3.290.0140.00316.54
7.3.280.0110.00616.46
7.3.270.0140.00317.40
7.3.260.0060.01016.63
7.3.250.0070.00916.45
7.3.240.0170.00016.45
7.3.230.0000.01716.51
7.3.210.0040.01416.89
7.3.200.0070.01019.39
7.3.190.0130.00916.44
7.3.180.0130.00616.89
7.3.170.0110.00416.82
7.3.160.0090.00616.53
7.3.120.0050.01014.86
7.3.110.0110.00714.96
7.3.100.0040.01015.20
7.3.90.0050.00915.23
7.3.80.0070.00715.16
7.3.70.0060.00915.11
7.3.60.0050.00814.90
7.3.50.0070.00514.98
7.3.40.0060.00815.06
7.3.30.0070.00814.86
7.3.20.0050.01116.94
7.3.10.0020.01116.77
7.3.00.0070.00516.55
7.2.330.0120.00616.75
7.2.320.0120.00616.86
7.2.310.0200.00316.88
7.2.300.0160.00016.63
7.2.290.0060.01216.82
7.2.250.0100.01015.25
7.2.240.0070.01315.28
7.2.230.0040.01115.23
7.2.220.0100.00315.31
7.2.210.0070.00915.38
7.2.200.0080.00715.21
7.2.190.0060.00515.11
7.2.180.0030.01015.13
7.2.170.0060.00815.30
7.2.130.0120.00417.11
7.2.120.0090.00616.66
7.2.110.0000.01316.73
7.2.100.0040.01116.76
7.2.90.0070.00716.71
7.2.80.0030.00716.95
7.2.70.0120.00617.18
7.2.60.0070.01016.72
7.2.50.0070.00716.90
7.2.40.0060.00617.02
7.2.30.0030.01017.25
7.2.20.0060.00616.91
7.2.10.0060.00916.82
7.2.00.0060.00617.11
7.1.330.0070.00615.95
7.1.320.0040.00616.08
7.1.310.0050.01016.05
7.1.300.0060.00515.86
7.1.290.0030.01016.10
7.1.280.0030.00915.89
7.1.270.0080.00615.98
7.1.260.0050.00815.96
7.1.250.0020.00516.03
7.1.100.0030.01218.16
7.1.70.0040.00817.46
7.1.60.0090.01519.70
7.1.50.0070.01417.18
7.1.00.0030.07722.30
7.0.200.0000.00716.42
7.0.140.0000.07021.97
7.0.60.0000.10019.97
7.0.50.0100.06317.95
7.0.40.0070.05320.00
7.0.30.0530.07320.46
7.0.20.0370.08320.10
7.0.10.0170.07720.11
7.0.00.0030.04020.20
5.6.280.0100.06721.15
5.6.210.0100.07720.50
5.6.200.0100.08318.22
5.6.190.0030.04320.56
5.6.180.0370.07320.42
5.6.170.0270.03720.40
5.6.160.0100.07720.54
5.6.150.0100.08018.23
5.6.140.0130.07718.08
5.6.130.0170.07318.07
5.6.120.0070.08721.01
5.6.110.0200.07720.99
5.6.100.0070.04321.10
5.6.90.0030.06021.12
5.6.80.0070.05020.37
5.6.70.1570.04720.32
5.5.350.0070.08020.30
5.5.340.0030.07017.91
5.5.330.0070.06720.40
5.5.320.0500.06720.17
5.5.310.0230.08320.16
5.5.300.0100.08017.92
5.5.290.0030.04017.88
5.5.280.0070.03720.84
5.5.270.0030.08320.64
5.5.260.0130.07720.97
5.5.250.0130.07320.79
5.5.240.0030.06720.16
5.4.450.0430.04728.28
5.4.440.0630.03728.28
5.4.430.0230.03727.24
5.4.420.0170.04326.72
5.4.410.0200.03726.15
5.4.400.0230.04026.13
5.4.390.0200.04326.13
5.4.380.0130.05718.50
5.4.370.0070.05718.71
5.4.360.0270.03718.57
5.4.350.0170.05018.45
5.4.340.0130.05318.51
5.4.320.0080.04512.46
5.4.310.0100.03412.45
5.4.300.0090.04812.45
5.4.290.0080.05312.45
5.4.280.0060.05412.35
5.4.270.0060.04912.35
5.4.260.0080.05112.35
5.4.250.0050.05512.35
5.4.240.0100.04912.35
5.4.230.0060.05212.34
5.4.220.0090.05712.34
5.4.210.0080.05212.34
5.4.200.0090.05412.34
5.4.190.0070.05512.34
5.4.180.0100.04712.34
5.4.170.0090.04812.35
5.4.160.0080.04812.35
5.4.150.0050.05012.34
5.4.140.0070.05312.03
5.4.130.0070.03712.02
5.4.120.0140.04511.97
5.4.110.0100.04911.97
5.4.100.0070.05011.96
5.4.90.0110.05111.97
5.4.80.0070.04111.97
5.4.70.0110.05211.96
5.4.60.0180.04911.96
5.4.50.0110.04611.96
5.4.40.0080.04511.95
5.4.30.0140.03711.95
5.4.20.0060.04411.95
5.4.10.0080.04811.95
5.4.00.0060.05011.44
5.3.290.0100.03712.80
5.3.280.0060.05312.71
5.3.270.0090.05512.72
5.3.260.0140.04112.72
5.3.250.0090.04212.72
5.3.240.0070.03812.72
5.3.230.0110.04012.71
5.3.220.0090.04712.68
5.3.210.0070.05312.68
5.3.200.0050.05612.68
5.3.190.0080.05212.68
5.3.180.0090.05212.67
5.3.170.0110.05312.67
5.3.160.0120.05612.67
5.3.150.0140.04812.67
5.3.140.0110.05912.66
5.3.130.0110.04612.66
5.3.120.0140.04512.66
5.3.110.0090.05112.66
5.3.100.0100.04812.12
5.3.90.0110.04912.08
5.3.80.0080.05312.08
5.3.70.0080.04812.07
5.3.60.0080.05112.06
5.3.50.0090.04912.00
5.3.40.0060.04312.00
5.3.30.0100.04011.96
5.3.20.0060.05011.73
5.3.10.0080.04011.70
5.3.00.0070.03811.69
5.2.170.0060.0389.20
5.2.160.0060.0299.19
5.2.150.0130.0269.19
5.2.140.0140.0369.19
5.2.130.0070.0479.15
5.2.120.0050.0369.15
5.2.110.0050.0399.16
5.2.100.0120.0399.15
5.2.90.0120.0389.15
5.2.80.0130.0419.15
5.2.70.0110.0509.15
5.2.60.0080.0479.10
5.2.50.0070.0449.07
5.2.40.0080.0399.04
5.2.30.0050.0479.02
5.2.20.0130.0369.02
5.2.10.0070.0418.92
5.2.00.0050.0428.78
5.1.60.0060.0378.07
5.1.50.0060.0368.07
5.1.40.0060.0378.05
5.1.30.0060.0398.39
5.1.20.0120.0318.41
5.1.10.0030.0418.14
5.1.00.0090.0548.14
5.0.50.0090.0266.63
5.0.40.0070.0296.48
5.0.30.0090.0396.30
5.0.20.0050.0246.27
5.0.10.0040.0306.25
5.0.00.0070.0326.24
4.4.90.0050.0234.78
4.4.80.0020.0204.76
4.4.70.0060.0194.75
4.4.60.0040.0194.75
4.4.50.0040.0254.77
4.4.40.0040.0414.71
4.4.30.0000.0264.75
4.4.20.0030.0234.84
4.4.10.0000.0254.85
4.4.00.0040.0354.76
4.3.110.0020.0204.67
4.3.100.0050.0234.66
4.3.90.0060.0224.64
4.3.80.0010.0384.58
4.3.70.0030.0244.63
4.3.60.0050.0214.62
4.3.50.0040.0224.63
4.3.40.0020.0384.54
4.3.30.0030.0293.29
4.3.20.0040.0303.27
4.3.10.0040.0303.23
4.3.00.0070.01726.13

preferences:
41.75 ms | 400 KiB | 5 Q