3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "This is a word", "<-#word#->", "<-#<-#<-#word#->#->#->", ]; $p = "word"; foreach ($strings as $string) { $string = preg_replace("/(?<!<-#)($p)(?!#->)/i", '<-#$1#->', $string); echo $string . 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.70.0110.00716.50
8.3.60.0140.00418.19
8.3.50.0110.01018.24
8.3.40.0070.00718.54
8.3.30.0080.00819.02
8.3.20.0040.00420.69
8.3.10.0040.00421.76
8.3.00.0000.00823.36
8.2.190.0060.01518.66
8.2.180.0130.00616.75
8.2.170.0110.00322.96
8.2.160.0090.00320.52
8.2.150.0040.01524.18
8.2.140.0000.00824.66
8.2.130.0110.00026.16
8.2.120.0050.00321.02
8.2.110.0040.00421.12
8.2.100.0040.00717.84
8.2.90.0030.00518.16
8.2.80.0000.00817.97
8.2.70.0050.00317.93
8.2.60.0060.00318.22
8.2.50.0040.00418.10
8.2.40.0000.00719.42
8.2.30.0000.00720.71
8.2.20.0000.00818.13
8.2.10.0000.00719.52
8.2.00.0060.00318.19
8.1.280.0100.01025.92
8.1.270.0000.00822.18
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00624.03
8.1.230.0040.00720.88
8.1.220.0000.00817.74
8.1.210.0040.00418.97
8.1.200.0000.00817.48
8.1.190.0000.00917.48
8.1.180.0080.00018.10
8.1.170.0000.00818.63
8.1.160.0040.00418.91
8.1.150.0030.00318.84
8.1.140.0000.00719.04
8.1.130.0000.00717.59
8.1.120.0000.00817.62
8.1.110.0030.00317.62
8.1.100.0030.00617.64
8.1.90.0080.00017.55
8.1.80.0030.00617.61
8.1.70.0040.00417.66
8.1.60.0030.00617.80
8.1.50.0000.00717.56
8.1.40.0040.00417.55
8.1.30.0000.01217.65
8.1.20.0000.00917.75
8.1.10.0040.00417.63
8.1.00.0030.00617.61
8.0.300.0040.00419.67
8.0.290.0060.00316.88
8.0.280.0030.00318.38
8.0.270.0070.00016.96
8.0.260.0000.00717.05
8.0.250.0000.00717.11
8.0.240.0000.00717.12
8.0.230.0000.00717.08
8.0.220.0030.00317.04
8.0.210.0040.00417.06
8.0.200.0000.00617.08
8.0.190.0040.00417.02
8.0.180.0040.00417.02
8.0.170.0000.00817.02
8.0.160.0050.00217.03
8.0.150.0000.00717.01
8.0.140.0000.00817.03
8.0.130.0050.00013.49
8.0.120.0000.00716.91
8.0.110.0020.00516.95
8.0.100.0000.00817.00
8.0.90.0050.00216.93
8.0.80.0110.01117.03
8.0.70.0000.00716.84
8.0.60.0040.00417.15
8.0.50.0000.00716.99
8.0.30.0080.00817.13
8.0.20.0110.00717.13
8.0.10.0040.00417.17
8.0.00.0060.01317.10
7.4.330.0020.00216.74
7.4.320.0000.00616.81
7.4.300.0090.00016.74
7.4.290.0040.00416.72
7.4.280.0000.00716.72
7.4.270.0030.00316.63
7.4.260.0000.00816.63
7.4.250.0000.00816.68
7.4.240.0000.00816.67
7.4.230.0030.00316.80
7.4.220.0030.00516.91
7.4.210.0090.00816.72
7.4.200.0070.00016.82
7.4.160.0110.00916.66
7.4.130.0140.00916.80
7.4.120.0080.00816.66
7.4.110.0060.01316.89
7.4.100.0090.00916.96
7.4.90.0060.01216.53
7.4.80.0090.01219.39
7.4.70.0050.01316.70
7.4.60.0120.00316.80
7.4.50.0000.01516.45
7.4.40.0090.00916.56
7.4.00.0030.01015.13
7.3.330.0030.00313.40
7.3.320.0060.00013.36
7.3.310.0000.00716.44
7.3.300.0000.00716.41
7.3.290.0070.00016.39
7.3.280.0120.00716.44
7.3.260.0070.01216.65
7.3.240.0090.01016.66
7.3.230.0060.00916.31
7.3.210.0090.00816.46
7.3.200.0100.00616.45
7.3.190.0150.00916.83
7.3.180.0080.00816.65
7.3.170.0180.00316.71
7.3.160.0130.00416.94
7.3.40.0070.00714.80
7.3.30.0040.00714.77
7.3.20.0080.00817.08
7.3.10.0110.01116.86
7.3.00.0130.00716.79
7.2.330.0180.00016.96
7.2.320.0080.01216.74
7.2.310.0100.00616.88
7.2.300.0040.01316.82
7.2.290.0100.00716.82
7.2.170.0120.00315.00
7.2.160.0070.00415.41
7.2.150.0060.00616.89
7.2.140.0130.00316.87
7.2.130.0120.00317.35
7.2.120.0070.00717.07
7.2.110.0070.00717.20
7.2.100.0030.01317.13
7.2.90.0070.01417.20
7.2.80.0080.00417.22
7.2.70.0110.00417.20
7.2.60.0070.00717.12
7.2.50.0100.00317.12
7.2.40.0090.00317.05
7.2.30.0150.00617.08
7.2.20.0090.00317.05
7.2.10.0140.01116.95
7.2.00.0170.00517.23
7.1.280.0000.01115.77
7.1.270.0060.00616.03
7.1.260.0030.00715.71
7.1.250.0090.00315.90

preferences:
63.5 ms | 401 KiB | 5 Q