3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = '<li id="item" class="list-item" href="#">Item</li><li id="item" class="list-item" href="#">Item</li>'; $find = "li"; $lenght = strlen($find); $pos1 = strpos($s, $find); $pos2 = strrpos($s, $find); //Echo substr($s,0,$pos1) . "a" . Substr($s,$pos1+$lenght,$pos2-$lenght-1) . "a" . Substr($s,$pos2+$lenght); Echo str_replace(array("<li ", "</li>"), array("<a ", "</a>"), $s);

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.60.0110.00416.38
8.3.50.0110.00416.16
8.3.40.0140.00318.86
8.3.30.0110.00418.54
8.3.20.0040.00420.34
8.3.10.0040.01122.08
8.3.00.0080.00017.62
8.2.180.0070.01118.01
8.2.170.0070.01022.96
8.2.160.0160.00320.38
8.2.150.0060.00325.66
8.2.140.0080.00024.66
8.2.130.0070.00322.09
8.2.120.0040.00426.35
8.2.110.0050.00521.06
8.2.100.0080.00417.55
8.2.90.0080.00019.05
8.2.80.0080.00017.97
8.2.70.0050.00317.50
8.2.60.0080.00017.93
8.2.50.0000.00818.10
8.2.40.0040.00422.28
8.2.30.0000.00920.95
8.2.20.0030.00618.05
8.2.10.0000.00717.91
8.2.00.0050.00218.02
8.1.280.0070.01125.92
8.1.270.0040.00423.92
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0100.00021.15
8.1.230.0000.01117.42
8.1.220.0080.00017.74
8.1.210.0090.00018.77
8.1.200.0000.00817.22
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0060.00318.65
8.1.160.0000.00819.04
8.1.150.0050.00320.62
8.1.140.0080.00019.55
8.1.130.0000.00718.82
8.1.120.0000.00717.29
8.1.110.0000.00817.45
8.1.100.0000.00717.26
8.1.90.0050.00317.39
8.1.80.0040.00417.38
8.1.70.0030.00317.42
8.1.60.0030.00517.56
8.1.50.0040.00417.46
8.1.40.0000.00717.30
8.1.30.0060.00317.54
8.1.20.0040.00417.55
8.1.10.0040.00417.36
8.1.00.0040.00417.39
8.0.300.0000.00718.77
8.0.290.0000.00716.63
8.0.280.0040.00418.32
8.0.270.0030.00517.16
8.0.260.0000.00616.80
8.0.250.0070.00016.86
8.0.240.0050.00216.97
8.0.230.0000.00916.75
8.0.220.0000.00716.76
8.0.210.0000.00716.79
8.0.200.0030.00316.90
8.0.190.0030.00516.80
8.0.180.0020.00516.88
8.0.170.0030.00316.73
8.0.160.0070.00016.86
8.0.150.0040.00416.84
8.0.140.0000.00816.75
8.0.130.0050.00013.25
8.0.120.0000.00816.73
8.0.110.0040.00416.61
8.0.100.0050.00216.82
8.0.90.0040.00416.65
8.0.80.0030.01216.75
8.0.70.0080.00016.65
8.0.60.0070.00016.86
8.0.50.0040.00416.77
8.0.30.0090.01017.00
8.0.20.0110.01017.40
8.0.10.0050.00317.01
8.0.00.0120.00616.82
7.4.330.0030.00315.55
7.4.320.0040.00416.53
7.4.300.0000.00616.55
7.4.290.0090.00016.45
7.4.280.0030.00516.40
7.4.270.0040.00416.33
7.4.260.0050.00013.16
7.4.250.0000.00716.52
7.4.240.0000.00716.50
7.4.230.0070.00016.63
7.4.220.0090.00916.57
7.4.210.0030.01016.56
7.4.200.0000.00816.32
7.4.160.0110.00716.30
7.4.150.0150.00617.40
7.4.140.0100.01117.86
7.4.130.0150.00316.42
7.4.120.0070.01216.51
7.4.110.0070.01016.62
7.4.100.0090.00916.55
7.4.90.0060.01216.44
7.4.80.0070.01019.39
7.4.70.0120.00316.59
7.4.60.0090.00616.26
7.4.50.0060.00916.35
7.4.40.0060.01116.65
7.4.30.0120.00616.34
7.4.00.0000.01114.98
7.3.330.0000.00513.04
7.3.320.0050.00012.94
7.3.310.0040.00316.19
7.3.300.0030.00316.18
7.3.290.0070.01016.22
7.3.280.0080.00916.19
7.3.270.0170.00917.40
7.3.260.0090.00816.24
7.3.250.0110.00616.18
7.3.240.0120.00516.46
7.3.230.0100.01316.35
7.3.210.0090.00616.11
7.3.200.0140.00616.27
7.3.190.0110.00516.54
7.3.180.0080.00816.38
7.3.170.0030.01316.23
7.3.160.0060.01016.08
7.3.10.0070.00716.72
7.3.00.0020.01116.50
7.2.330.0170.00016.64
7.2.320.0120.00416.52
7.2.310.0070.01316.67
7.2.300.0090.00916.67
7.2.290.0060.00916.51
7.2.130.0040.00916.58
7.2.120.0050.00816.73
7.2.110.0060.00416.72
7.2.100.0030.00916.76
7.2.90.0020.01116.60
7.2.80.0110.00616.67
7.2.70.0030.01016.53
7.2.60.0040.00916.76
7.2.50.0080.00516.87
7.2.40.0090.00216.76
7.2.30.0060.00916.81
7.2.20.0090.00616.69
7.2.10.0100.00416.69
7.2.00.0040.01017.70
7.1.250.0040.01115.79
7.1.240.0030.00615.70
7.1.230.0050.00215.77
7.1.220.0040.01115.66
7.1.210.0050.00515.88
7.1.200.0080.00615.46
7.1.190.0000.00815.59
7.1.180.0140.00015.64
7.1.170.0060.00615.75
7.1.160.0080.00815.68
7.1.150.0030.00715.80
7.1.140.0060.00615.75
7.1.130.0090.00015.64
7.1.120.0150.00315.55
7.1.110.0170.00015.69
7.1.100.0050.00916.87
7.1.90.0080.00315.61
7.1.80.0080.00315.55
7.1.70.0700.01515.31
7.1.60.0650.01324.47
7.1.50.0760.01424.37
7.1.40.0690.00324.13
7.1.30.0680.01724.08
7.1.20.0770.01024.29
7.1.10.0650.01015.08
7.1.00.0700.01015.16
7.0.330.0040.00715.18
7.0.320.0000.00714.87
7.0.310.0080.00515.20
7.0.300.0000.01015.28
7.0.290.0070.01115.29
7.0.280.0080.00615.16
7.0.270.0130.00315.26
7.0.260.0090.00314.99
7.0.250.0040.00715.42
7.0.240.0030.00515.31
7.0.230.0000.01114.97
7.0.220.0060.00615.45
7.0.210.0070.00715.22
7.0.200.0920.01015.18
7.0.190.0980.00615.06
7.0.180.0620.00814.95
7.0.170.0850.01414.81
7.0.160.0800.00314.79
7.0.150.0600.00814.88
7.0.140.0500.00714.89
7.0.130.0430.01015.06
7.0.120.0460.00415.14
7.0.110.0530.00714.83
7.0.100.0620.01014.89
7.0.90.0560.01314.89
7.0.80.0550.01214.86
7.0.70.0540.01114.84
7.0.60.0530.01314.87
7.0.50.0670.00714.86
7.0.40.0820.01213.99
7.0.30.0500.01014.04
7.0.20.0500.01014.03
7.0.10.0660.00613.92
7.0.00.0580.01013.92
5.6.380.0050.00514.60

preferences:
39.81 ms | 401 KiB | 5 Q