3v4l.org

run code in 300+ PHP versions simultaneously
<?php $body = "<p>在过去的一年中,“抖音”通过短视频的形式在人们 <h1>抖音怎么改名字啊?</h1> <img src='https://example.com/test.jpg' title='我想改名字'/></p>"; $keywords = [ 0=>['id'=>1,'title'=>'改名字','url'=>'https://www.example.com/gaimingzi.html'], 1=>['id'=>2,'title'=>'名字','url'=>'https://www.example.com/mingzi.html'], 2=>['id'=>3,'title'=>'短视频','url'=>'https://www.example.com/duanshipin.html'], ]; foreach ($keywords as $keyword) { $body = preg_replace('/(>[^<>]*?)(' . $keyword['title'] . ')([^<>]*?<)/', '$1<a href="'. $keyword['url']. '" target="_blank">$2</a>$3', $body,1); } echo $body;

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.5.00.0080.01320.21
8.4.150.0020.00114.05
8.4.140.0130.00917.71
8.4.130.0140.00718.78
8.4.120.0080.00417.89
8.4.110.0040.00424.24
8.4.100.0100.01119.09
8.4.90.0080.01220.59
8.4.80.0150.00618.30
8.4.70.0110.00517.95
8.4.60.0100.01018.84
8.4.50.0110.01019.97
8.4.40.0150.00319.74
8.4.30.0070.01117.88
8.4.20.0130.00720.51
8.4.10.0030.00619.87
8.3.280.0170.00418.82
8.3.270.0110.01116.82
8.3.260.0130.00616.79
8.3.250.0110.01016.79
8.3.240.0090.01216.91
8.3.230.0100.00716.64
8.3.220.0090.00719.17
8.3.210.0090.00616.75
8.3.200.0100.00916.97
8.3.190.0090.00918.89
8.3.180.0100.00916.59
8.3.170.0110.00716.63
8.3.160.0040.00418.45
8.3.150.0070.00317.23
8.3.140.0080.00016.81
8.3.130.0060.00318.59
8.3.120.0060.01020.49
8.3.110.0070.00316.63
8.3.100.0070.00424.06
8.3.90.0080.00026.77
8.3.80.0040.00416.88
8.3.70.0070.00716.71
8.3.60.0040.01118.43
8.3.50.0140.00517.43
8.3.40.0090.00618.79
8.3.30.0180.00318.87
8.3.20.0060.00318.98
8.3.10.0040.00423.30
8.3.00.0080.00020.76
8.2.290.0090.00716.99
8.2.280.0080.00818.80
8.2.270.0190.00017.08
8.2.260.0040.01418.96
8.2.250.0120.00818.50
8.2.240.0120.00619.04
8.2.230.0030.00720.94
8.2.220.0180.00037.54
8.2.210.0110.00726.77
8.2.200.0040.00416.75
8.2.190.0060.00918.43
8.2.180.0120.00325.92
8.2.170.0140.00719.07
8.2.160.0060.00922.96
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0040.00421.06
8.2.110.0030.01220.32
8.2.100.0000.01218.03
8.2.90.0030.00620.54
8.2.80.0050.00317.97
8.2.70.0050.00317.88
8.2.60.0030.00618.04
8.2.50.0040.00418.07
8.2.40.0040.00418.16
8.2.30.0000.00818.17
8.2.20.0040.00418.23
8.2.10.0060.00318.30
8.2.00.0050.00318.19
8.1.330.0110.00916.57
8.1.320.0130.00516.56
8.1.310.0100.00718.45
8.1.300.0090.00018.03
8.1.290.0060.00330.84
8.1.280.0110.00425.92
8.1.270.0000.01023.97
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0080.00321.11
8.1.230.0040.00721.05
8.1.220.0080.00017.91
8.1.210.0040.00818.85
8.1.200.0060.00317.47
8.1.190.0000.00817.23
8.1.180.0060.00318.10
8.1.170.0000.00918.96
8.1.160.0000.00818.92
8.1.150.0000.00719.02
8.1.140.0000.00722.10
8.1.130.0070.00020.20
8.1.120.0000.00717.56
8.1.110.0000.00717.53
8.1.100.0030.00617.61
8.1.90.0070.00417.66
8.1.80.0040.00417.53
8.1.70.0000.00817.53
8.1.60.0050.00317.75
8.1.50.0000.00817.73
8.1.40.0070.00017.70
8.1.30.0060.00317.89
8.1.20.0090.00017.75
8.1.10.0080.00017.83
8.1.00.0030.00617.77
8.0.300.0000.00720.15
8.0.290.0080.00017.00
8.0.280.0030.00318.37
8.0.270.0080.00016.98
8.0.260.0060.00018.51
8.0.250.0000.00817.03
8.0.240.0040.00417.05
8.0.230.0000.00717.15
8.0.220.0070.00017.09
8.0.210.0000.00616.94
8.0.200.0030.00317.02
8.0.190.0040.00417.09
8.0.180.0050.00317.11
8.0.170.0030.00617.00
8.0.160.0060.00317.09
8.0.150.0000.00816.87
8.0.140.0040.00416.94
8.0.130.0030.00313.51
8.0.120.0070.00017.06
8.0.110.0000.00817.05
8.0.100.0080.00016.94
8.0.90.0050.00317.06
8.0.80.0060.00917.03
8.0.70.0070.00017.07
8.0.60.0040.00417.20
8.0.50.0040.00417.04
8.0.30.0140.00617.24
8.0.20.0140.00617.40
8.0.10.0030.00517.26
8.0.00.0110.00917.08
7.4.330.0000.00515.55
7.4.320.0000.00616.85
7.4.300.0000.00816.70
7.4.290.0070.00016.69
7.4.280.0040.00416.75
7.4.270.0030.00316.76
7.4.260.0000.00716.63
7.4.250.0000.00716.82
7.4.240.0000.00716.86
7.4.230.0070.00016.92
7.4.220.0080.00016.50
7.4.210.0060.01016.79
7.4.200.0000.00716.59
7.4.160.0100.00716.68
7.4.140.0090.01017.86
7.4.130.0130.00416.76
7.4.120.0100.01116.87
7.4.110.0090.01816.80
7.4.100.0090.01216.65
7.4.90.0120.00616.71
7.4.80.0100.01319.39
7.4.70.0120.00616.69
7.4.60.0030.01216.72
7.4.50.0060.00916.74
7.4.40.0030.01716.91
7.4.00.0000.01315.24
7.3.330.0000.00513.29
7.3.320.0060.00013.23
7.3.310.0060.00316.46
7.3.300.0070.00016.41
7.3.290.0040.00416.42
7.3.280.0070.01016.48
7.3.260.0120.00716.53
7.3.240.0110.00816.67
7.3.230.0220.00416.88
7.3.210.0130.00316.84
7.3.200.0060.01116.47
7.3.190.0100.00816.50
7.3.180.0160.00316.43
7.3.170.0160.00716.84
7.3.160.0080.00816.69
7.2.330.0130.00316.69
7.2.320.0110.00616.77
7.2.310.0090.00916.93
7.2.300.0090.00717.09
7.2.290.0130.00317.00
7.2.110.0250.00714.80
7.2.100.0140.01114.70
7.2.90.0220.00915.00
7.2.80.0190.00614.75
7.2.70.0200.01015.24
7.2.60.0290.01115.27
7.2.50.0350.00015.36
7.2.40.0340.01015.31
7.2.30.0200.01015.09
7.2.20.0270.00815.22
7.2.10.0240.00315.17
7.2.00.0190.00615.33
7.1.230.0190.01014.05
7.1.220.0150.00914.27
7.1.210.0220.00314.05
7.1.200.0270.01214.27
7.1.190.0160.00914.20
7.1.180.0220.00714.13
7.1.170.0210.00914.29
7.1.160.0970.01014.02
7.1.150.0290.01114.08
7.1.140.0280.00313.82
7.1.130.0340.00014.11
7.1.120.0160.00913.96
7.1.110.0100.01014.04
7.1.100.0130.00914.28
7.1.90.0150.01113.87
7.1.80.0260.00413.92
7.1.70.0210.00413.90
7.1.60.0200.00614.04
7.1.50.0350.00014.12
7.1.40.0360.00614.15
7.1.30.0200.01314.19
7.1.20.0140.01013.87
7.1.10.0210.01114.16
7.1.00.0170.01014.03
5.6.380.0090.00614.20

preferences:
174.84 ms | 403 KiB | 5 Q