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[4]; 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.0120.00318.43
8.3.50.0000.01519.88
8.3.40.0100.01019.27
8.3.30.0030.01318.78
8.3.20.0040.00420.29
8.3.10.0040.00421.60
8.3.00.0040.00420.89
8.2.180.0060.01318.43
8.2.170.0130.00322.96
8.2.160.0030.01019.24
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00420.53
8.2.120.0050.00326.35
8.2.110.0030.00620.35
8.2.100.0110.00017.97
8.2.90.0050.00318.28
8.2.80.0090.00018.05
8.2.70.0000.00817.91
8.2.60.0040.00418.34
8.2.50.0030.00618.10
8.2.40.0070.00320.68
8.2.30.0040.00419.41
8.2.20.0080.00017.91
8.2.10.0040.00418.15
8.2.00.0040.00418.19
8.1.280.0070.00725.92
8.1.270.0030.00523.88
8.1.260.0080.00028.09
8.1.250.0040.00428.09
8.1.240.0040.00419.32
8.1.230.0030.00920.91
8.1.220.0060.00317.77
8.1.210.0100.00018.91
8.1.200.0040.00417.48
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0080.00018.80
8.1.160.0000.00719.05
8.1.150.0000.00718.83
8.1.140.0000.00719.66
8.1.130.0000.00817.57
8.1.120.0080.00217.63
8.1.110.0040.00417.67
8.1.100.0000.00717.65
8.1.90.0000.00817.64
8.1.80.0040.00417.56
8.1.70.0000.01117.61
8.1.60.0030.00517.61
8.1.50.0040.00417.70
8.1.40.0080.00017.75
8.1.30.0040.00417.66
8.1.20.0000.00717.71
8.1.10.0000.00817.64
8.1.00.0040.00417.57
8.0.300.0080.00020.16
8.0.290.0000.00816.88
8.0.280.0070.00018.41
8.0.270.0040.00417.34
8.0.260.0070.00017.04
8.0.250.0040.00417.23
8.0.240.0050.00317.08
8.0.230.0000.00717.17
8.0.220.0000.00716.98
8.0.210.0000.00816.99
8.0.200.0000.00717.21
8.0.190.0040.00417.07
8.0.180.0000.00717.14
8.0.170.0030.00517.18
8.0.160.0040.00417.03
8.0.150.0000.00817.07
8.0.140.0050.00217.16
8.0.130.0030.00613.58
8.0.120.0060.00317.10
8.0.110.0040.00417.18
8.0.100.0000.00816.93
8.0.90.0040.00417.00
8.0.80.0120.00417.10
8.0.70.0040.00417.05
8.0.60.0020.00517.07
8.0.50.0040.00417.18
8.0.30.0100.00817.38
8.0.20.0120.01017.41
8.0.10.0070.00017.19
8.0.00.0130.00316.78
7.4.330.0050.00015.08
7.4.320.0000.00716.63
7.4.300.0050.00316.78
7.4.290.0050.00216.65
7.4.280.0030.00516.72
7.4.270.0030.00316.83
7.4.260.0070.00016.78
7.4.250.0030.00516.79
7.4.240.0040.00416.84
7.4.230.0070.00016.91
7.4.220.0030.01616.81
7.4.210.0160.00416.84
7.4.200.0000.00716.67
7.4.160.0160.00816.64
7.4.150.0040.01517.40
7.4.140.0140.00717.86
7.4.130.0150.00516.83
7.4.120.0110.00816.68
7.4.110.0060.01116.71
7.4.100.0040.01216.81
7.4.90.0100.00716.98
7.4.80.0120.00619.39
7.4.70.0150.00616.74
7.4.60.0060.00916.77
7.4.50.0060.00316.56
7.4.40.0120.00416.54
7.4.30.0080.00916.61
7.4.00.0060.01015.31
7.3.330.0050.00213.48
7.3.320.0040.00413.45
7.3.310.0000.00816.50
7.3.300.0000.00716.42
7.3.290.0030.00316.47
7.3.280.0060.01116.49
7.3.270.0090.00917.40
7.3.260.0140.00716.61
7.3.250.0110.00816.63
7.3.240.0120.00816.57
7.3.230.0070.01116.43
7.3.210.0090.00916.68
7.3.200.0090.00916.59
7.3.190.0130.00316.68
7.3.180.0100.01016.73
7.3.170.0060.01016.55
7.3.160.0030.01316.54
7.3.10.0070.00716.79
7.3.00.0110.00316.89
7.2.330.0100.01216.93
7.2.320.0090.00916.86
7.2.310.0110.01116.63
7.2.300.0030.01316.88
7.2.290.0060.01116.79
7.2.130.0100.00417.04
7.2.120.0040.01116.96
7.2.110.0100.00717.13
7.2.100.0090.00617.13
7.2.90.0130.00317.10
7.2.80.0070.00717.19
7.2.70.0090.00017.29
7.2.60.0060.00816.89
7.2.50.0070.00717.16
7.2.40.0040.00817.02
7.2.30.0030.00617.02
7.2.20.0040.01117.00
7.2.10.0040.01216.96
7.2.00.0070.00518.30
7.1.250.0040.00816.04
7.1.200.0000.01315.99
7.1.70.0070.00017.46
7.1.60.0110.01419.90
7.1.00.0000.07722.59
7.0.200.0180.00415.10
7.0.70.0100.06319.95
7.0.60.0200.05719.93
7.0.50.0100.06720.36
7.0.40.0170.06720.39
7.0.30.0270.05720.34
7.0.20.0130.06720.40
7.0.10.0130.07020.22
7.0.00.0200.06020.26
5.6.280.0070.07021.05
5.6.220.0170.06020.63
5.6.210.0230.05320.52
5.6.200.0370.07021.01
5.6.190.0300.04721.17
5.6.180.0300.05021.09
5.6.170.0270.05021.20
5.6.160.0230.05721.09
5.6.150.0200.05721.00
5.6.140.0230.05321.17
5.6.130.0170.06321.01
5.6.120.0170.07021.07
5.6.110.0300.05021.16
5.6.100.0370.05021.07
5.6.90.0300.06021.17
5.6.80.0430.05720.59
5.6.70.0430.04720.55
5.6.60.0300.05720.47
5.6.50.0400.07320.56
5.6.40.0470.05020.35
5.6.30.0370.05320.53
5.6.20.0330.05720.45
5.6.10.0230.06720.43
5.6.00.0170.07020.52
5.5.360.0230.05320.36
5.5.350.0270.05320.39
5.5.340.0230.07720.93
5.5.330.0200.07020.83
5.5.320.0170.05720.98
5.5.310.0270.06320.67
5.5.300.0230.05320.83
5.5.290.0300.04720.94
5.5.280.0170.05720.83
5.5.270.0370.05320.70
5.5.260.0300.06320.91
5.5.250.0270.06720.66
5.5.240.0330.05720.32
5.5.230.0270.06320.38
5.5.220.0330.05720.27
5.5.210.0330.05020.36
5.5.200.0330.06720.19
5.5.190.0230.06320.30
5.5.180.0500.04320.21
5.5.160.0330.06020.15
5.5.150.0330.05320.14
5.5.140.0200.06320.30
5.5.130.0330.05320.24
5.5.120.0400.05020.18
5.5.110.0330.06020.24
5.5.100.0270.05720.06
5.5.90.0470.03720.12
5.5.80.0300.06320.22
5.5.70.0370.05720.14
5.5.60.0230.06020.12
5.5.50.0230.06020.02
5.5.40.0330.05020.21
5.5.30.0270.06020.19
5.5.20.0430.05020.16
5.5.10.0230.06720.18
5.5.00.0430.07719.97

preferences:
79.9 ms | 401 KiB | 5 Q