3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace($row){ $replaced = preg_replace_callback("~(\<span class=\"itemopener\"\>)(\d{2})\s(top\</span\>.*\<span class=\"allopener\"\>).{3}(\</span\>)~iU", function($matches){ $str = $matches[1] . $matches[3] . $matches[2] . $matches[5]; return $str; }, $row); return $replaced; } $s = '<span class="itemopener">82 top</span>&nbsp;<span class="allopener">all</span>'; $replaced = replace($s); echo "<pre>" . print_r($replaced, 1) . "</pre>"; exit();

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.01118.57
8.3.50.0090.01122.95
8.3.40.0100.00719.02
8.3.30.0100.00718.88
8.3.20.0000.00720.16
8.3.10.0040.00421.90
8.3.00.0040.00421.02
8.2.180.0150.00718.66
8.2.170.0090.00622.96
8.2.160.0110.00319.34
8.2.150.0000.00825.66
8.2.140.0000.00824.66
8.2.130.0000.00820.53
8.2.120.0040.00426.35
8.2.110.0060.00321.07
8.2.100.0060.00618.16
8.2.90.0000.00818.03
8.2.80.0050.00319.11
8.2.70.0060.00317.93
8.2.60.0080.00417.92
8.2.50.0050.00318.10
8.2.40.0040.00420.48
8.2.30.0030.00519.41
8.2.20.0000.00717.98
8.2.10.0040.00418.19
8.2.00.0070.00018.14
8.1.280.0090.00625.92
8.1.270.0040.00423.92
8.1.260.0080.00028.09
8.1.250.0000.00728.09
8.1.240.0060.00319.71
8.1.230.0030.00920.99
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0100.00017.48
8.1.190.0040.00417.47
8.1.180.0060.00319.03
8.1.170.0040.00418.74
8.1.160.0040.00419.01
8.1.150.0040.00418.98
8.1.140.0000.00719.63
8.1.130.0000.00717.74
8.1.120.0040.00417.62
8.1.110.0050.00217.50
8.1.100.0000.00817.52
8.1.90.0000.00817.48
8.1.80.0000.00717.53
8.1.70.0000.00917.67
8.1.60.0000.00717.75
8.1.50.0050.00317.70
8.1.40.0060.00317.67
8.1.30.0030.00617.72
8.1.20.0040.00417.72
8.1.10.0090.00017.64
8.1.00.0040.00417.57
8.0.300.0000.00820.12
8.0.290.0090.00017.00
8.0.280.0000.00718.55
8.0.270.0030.00317.36
8.0.260.0070.00017.24
8.0.250.0000.00717.28
8.0.240.0070.00017.06
8.0.230.0000.00717.20
8.0.220.0030.00517.12
8.0.210.0030.00617.12
8.0.200.0000.00617.21
8.0.190.0070.00017.12
8.0.180.0050.00317.08
8.0.170.0080.00017.04
8.0.160.0040.00417.08
8.0.150.0040.00416.95
8.0.140.0030.00517.04
8.0.130.0030.00313.55
8.0.120.0000.00917.09
8.0.110.0030.00617.08
8.0.100.0000.00717.14
8.0.90.0000.00716.99
8.0.80.0090.01317.18
8.0.70.0050.00317.11
8.0.60.0040.00417.00
8.0.50.0030.00516.97
8.0.30.0070.01317.38
8.0.20.0070.01117.45
8.0.10.0070.00017.35
8.0.00.0090.00616.77
7.4.330.0060.00015.08
7.4.320.0000.00716.88
7.4.300.0030.00516.71
7.4.290.0030.00316.85
7.4.280.0040.00416.87
7.4.270.0030.00316.79
7.4.260.0030.00316.73
7.4.250.0070.00016.80
7.4.240.0030.00316.83
7.4.230.0070.00016.94
7.4.220.0070.01316.86
7.4.210.0120.00516.85
7.4.200.0000.00716.84
7.4.160.0120.00416.71
7.4.150.0090.00917.40
7.4.140.0080.00917.86
7.4.130.0100.00916.69
7.4.120.0140.00616.68
7.4.110.0070.01016.75
7.4.100.0100.00716.83
7.4.90.0120.00616.59
7.4.80.0060.01219.39
7.4.70.0180.00316.89
7.4.60.0030.01316.74
7.4.50.0070.00716.75
7.4.40.0100.01316.86
7.4.30.0070.01116.80
7.4.00.0070.00715.16
7.3.330.0030.00613.55
7.3.320.0080.00013.39
7.3.310.0030.00316.39
7.3.300.0030.00316.54
7.3.290.0050.00216.31
7.3.280.0090.00816.50
7.3.270.0100.00717.40
7.3.260.0120.00616.60
7.3.250.0120.00716.60
7.3.240.0060.01416.57
7.3.230.0100.00716.44
7.3.210.0060.01616.52
7.3.200.0110.00516.68
7.3.190.0140.00316.70
7.3.180.0090.01216.58
7.3.170.0070.01016.61
7.3.160.0090.00616.54
7.2.330.0090.00916.89
7.2.320.0120.00616.83
7.2.310.0150.00316.83
7.2.300.0100.00616.70
7.2.290.0070.01116.97
7.2.00.0060.00619.39
7.1.70.0000.00717.39
7.1.60.0100.01319.90
7.1.00.0070.07322.39
7.0.200.0230.00014.77
7.0.70.0500.07019.92
7.0.60.0400.04720.09
7.0.50.0330.06020.35
7.0.40.0330.04720.38
7.0.30.0300.06320.19
7.0.20.0330.06020.22
7.0.10.0430.07020.25
7.0.00.0370.08720.29
5.6.280.0100.06721.02
5.6.220.0370.08020.73
5.6.210.0400.06020.71
5.6.200.0330.05721.10
5.6.190.0400.06321.20
5.6.180.0330.06021.14
5.6.170.0230.06721.18
5.6.160.0300.06020.97
5.6.150.0370.05321.17
5.6.140.0430.05021.10
5.6.130.0370.06321.17
5.6.120.0170.05321.17
5.6.110.0200.05721.01
5.6.100.0170.08021.10
5.6.90.0200.06321.00
5.6.80.0430.04720.41
5.6.70.0270.06020.40
5.6.60.0300.05720.36
5.6.50.0300.07020.59
5.6.40.0300.06020.36
5.6.30.0400.04720.53
5.6.20.0330.06020.52
5.6.10.0270.05720.53
5.6.00.0270.05720.43
5.5.360.0600.06720.48
5.5.350.0470.06320.44
5.5.340.0370.06320.71
5.5.330.0030.06720.98
5.5.320.0330.05320.97
5.5.310.0270.08720.99
5.5.300.0400.05720.89
5.5.290.0500.04720.80
5.5.280.0030.06720.82
5.5.270.0300.05720.91
5.5.260.0100.06320.66
5.5.250.0330.05320.65
5.5.240.0400.06320.25
5.5.230.0330.05320.22
5.5.220.0370.05320.24
5.5.210.0200.06720.32
5.5.200.0230.06020.14
5.5.190.0370.05320.29
5.5.180.0270.06720.30
5.5.160.0200.06320.28
5.5.150.0330.05320.32
5.5.140.0400.05320.29
5.5.130.0370.05020.30
5.5.120.0300.05720.02
5.5.110.0330.05320.31
5.5.100.0230.06720.02
5.5.90.0370.05020.07
5.5.80.0130.05320.04
5.5.70.0130.05320.14
5.5.60.0100.05720.00
5.5.50.0130.05720.06
5.5.40.0470.03320.16
5.5.30.0330.05320.16
5.5.20.0400.04720.02
5.5.10.0300.06020.14
5.5.00.0430.07320.17

preferences:
60 ms | 401 KiB | 5 Q