3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace($row){ $replaced = preg_replace_callback("~(\<span class=\"itemopener\"\>)(\d{1,5})\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.4.130.0150.00618.03
8.4.120.0110.00920.54
8.4.110.0140.00722.60
8.4.100.0050.00418.21
8.4.90.0140.00717.98
8.4.80.0040.00418.07
8.4.70.0080.01119.92
8.4.60.0040.00418.94
8.4.50.0090.01218.59
8.4.40.0060.00319.70
8.4.30.0060.00317.90
8.4.20.0130.01017.94
8.4.10.0100.00617.87
8.3.260.0040.00516.72
8.3.250.0100.00918.74
8.3.240.0140.00516.53
8.3.230.0130.00716.73
8.3.220.0120.00518.76
8.3.210.0090.00616.74
8.3.200.0040.00416.93
8.3.190.0100.00917.13
8.3.180.0090.00918.85
8.3.170.0070.01118.82
8.3.160.0180.00017.22
8.3.150.0130.00716.91
8.3.140.0060.00917.13
8.3.130.0210.00217.85
8.3.120.0030.00519.14
8.3.110.0040.00420.94
8.3.100.0070.00417.08
8.3.90.0090.00026.77
8.3.80.0210.00716.75
8.3.70.0100.00718.68
8.3.60.0090.00618.55
8.3.50.0120.00323.01
8.3.40.0090.00619.01
8.3.30.0120.00318.95
8.3.20.0040.00420.34
8.3.10.0000.00721.76
8.3.00.0080.00020.83
8.2.290.0080.01120.82
8.2.280.0080.01318.95
8.2.270.0090.00916.87
8.2.260.0050.00316.82
8.2.250.0040.01116.91
8.2.240.0000.00919.20
8.2.230.0000.00922.58
8.2.220.0030.00624.06
8.2.210.0030.00526.77
8.2.200.0100.01018.79
8.2.190.0120.00917.13
8.2.180.0060.00918.67
8.2.170.0120.00619.26
8.2.160.0110.00419.39
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0030.00521.06
8.2.110.0030.00722.38
8.2.100.0120.00017.97
8.2.90.0080.00019.17
8.2.80.0050.00317.97
8.2.70.0080.00017.88
8.2.60.0030.00519.20
8.2.50.0000.00818.10
8.2.40.0080.00020.42
8.2.30.0070.00019.27
8.2.20.0040.00417.92
8.2.10.0070.00018.14
8.2.00.0040.00418.05
8.1.330.0110.00916.88
8.1.320.0140.00516.28
8.1.310.0090.00018.19
8.1.300.0060.00319.76
8.1.290.0060.00630.84
8.1.280.0110.01125.92
8.1.270.0000.01023.99
8.1.260.0080.00026.35
8.1.250.0140.00428.09
8.1.240.0030.00623.81
8.1.230.0110.00020.98
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0090.00317.25
8.1.190.0050.00517.38
8.1.180.0040.00418.10
8.1.170.0050.00718.39
8.1.160.0000.00719.01
8.1.150.0000.00718.84
8.1.140.0070.00019.50
8.1.130.0040.00417.77
8.1.120.0000.00717.61
8.1.110.0000.00817.64
8.1.100.0000.00817.67
8.1.90.0030.00617.66
8.1.80.0000.00717.66
8.1.70.0030.00317.52
8.1.60.0040.00417.65
8.1.50.0000.00817.59
8.1.40.0080.00017.66
8.1.30.0030.00617.74
8.1.20.0090.00017.80
8.1.10.0040.00417.78
8.1.00.0000.01217.54
8.0.300.0060.00318.77
8.0.290.0000.00716.75
8.0.280.0030.00318.36
8.0.270.0040.00417.15
8.0.260.0000.00617.33
8.0.250.0000.00717.08
8.0.240.0000.00717.11
8.0.230.0030.00317.16
8.0.220.0090.00017.16
8.0.210.0040.00217.10
8.0.200.0000.00717.21
8.0.190.0000.00817.16
8.0.180.0000.00717.16
8.0.170.0040.00417.16
8.0.160.0000.00817.16
8.0.150.0040.00416.96
8.0.140.0000.00717.16
8.0.130.0030.00313.54
8.0.120.0080.00017.09
8.0.110.0070.00017.16
8.0.100.0000.00717.00
8.0.90.0040.00417.13
8.0.80.0110.00417.19
8.0.70.0040.00417.16
8.0.60.0000.00717.21
8.0.50.0000.00817.13
8.0.30.0100.00917.14
8.0.20.0120.01117.40
8.0.10.0000.00717.07
8.0.00.0030.01717.02
7.4.330.0000.00715.08
7.4.320.0060.00016.66
7.4.300.0030.00316.74
7.4.290.0000.00916.84
7.4.280.0040.00416.87
7.4.270.0070.00016.78
7.4.260.0040.00416.66
7.4.250.0040.00416.65
7.4.240.0000.00816.82
7.4.230.0020.00516.54
7.4.220.0160.00416.78
7.4.210.0090.00916.77
7.4.200.0040.00416.72
7.4.160.0160.00316.66
7.4.150.0160.01017.40
7.4.140.0090.01117.86
7.4.130.0090.00816.72
7.4.120.0130.00316.73
7.4.110.0040.01416.77
7.4.100.0070.01016.73
7.4.90.0130.00416.79
7.4.80.0120.00619.39
7.4.70.0090.01516.69
7.4.60.0090.01216.88
7.4.50.0090.00616.48
7.4.40.0120.00616.55
7.4.30.0120.00416.85
7.4.10.0060.01315.21
7.4.00.0080.00915.20
7.3.330.0020.00213.53
7.3.320.0000.00513.55
7.3.310.0030.00316.50
7.3.300.0000.00716.24
7.3.290.0030.00316.36
7.3.280.0100.00716.51
7.3.270.0070.01017.40
7.3.260.0180.00016.68
7.3.250.0120.00716.62
7.3.240.0080.01316.76
7.3.230.0130.01016.46
7.3.210.0120.00616.63
7.3.200.0070.01016.64
7.3.190.0060.00916.66
7.3.180.0160.00616.66
7.3.170.0120.00916.54
7.3.160.0030.01316.61
7.3.130.0000.01715.29
7.3.120.0050.01215.15
7.3.110.0080.00714.95
7.3.100.0080.00615.05
7.3.90.0080.00615.07
7.3.80.0070.00815.00
7.3.70.0080.00515.04
7.3.60.0070.00714.91
7.3.50.0040.01014.74
7.3.40.0070.00714.96
7.3.30.0050.00914.90
7.3.20.0040.01116.81
7.3.10.0070.00816.74
7.3.00.0060.00816.71
7.2.330.0150.00316.92
7.2.320.0100.00716.84
7.2.310.0130.00316.85
7.2.300.0090.00916.82
7.2.290.0090.00916.81
7.2.260.0110.00715.40
7.2.250.0070.00915.25
7.2.240.0090.01015.32
7.2.230.0050.01215.29
7.2.220.0050.00915.16
7.2.210.0080.00515.38
7.2.200.0060.00715.25
7.2.190.0040.00915.24
7.2.180.0050.00915.34
7.2.170.0060.00715.25
7.2.160.0090.00615.32
7.2.150.0090.00617.16
7.2.140.0020.01417.17
7.2.130.0080.00817.21
7.2.120.0060.00816.96
7.2.110.0050.00817.06
7.2.100.0060.00717.02
7.2.90.0070.00917.03
7.2.80.0070.00717.11
7.2.70.0030.01317.18
7.2.60.0090.00617.12
7.2.50.0070.00817.08
7.2.40.0050.00917.15
7.2.30.0060.00817.10
7.2.20.0050.01017.17
7.2.10.0060.01017.10
7.2.00.0060.00817.54
7.1.330.0100.00615.93
7.1.320.0050.00816.00
7.1.310.0080.00616.02
7.1.300.0040.01115.92
7.1.290.0040.00915.93
7.1.280.0040.00815.83
7.1.270.0060.00715.93
7.1.260.0090.00515.93
7.1.250.0120.00315.91
7.1.240.0090.00616.05
7.1.230.0110.00515.87
7.1.220.0120.00515.95
7.1.210.0090.00715.87
7.1.200.0100.00515.91
7.1.190.0100.00815.85
7.1.180.0050.01016.04
7.1.170.0080.00915.91
7.1.160.0060.01116.12
7.1.150.0050.01115.94
7.1.140.0100.00516.05
7.1.130.0090.00716.00
7.1.120.0070.00915.98
7.1.110.0050.01216.06
7.1.100.0070.00815.93
7.1.90.0090.00715.90
7.1.80.0090.00616.02
7.1.70.0060.00816.49
7.1.60.0100.00916.97
7.1.50.0110.00616.00
7.1.40.0060.00815.94
7.1.30.0090.00415.99
7.1.20.0090.00715.89
7.1.10.0090.00715.79
7.1.00.0090.02317.61
7.0.330.0080.00515.41
7.0.320.0080.00615.44
7.0.310.0070.01015.40
7.0.300.0090.00615.54
7.0.290.0080.00815.28
7.0.280.0110.00615.65
7.0.270.0080.00615.49
7.0.260.0110.00415.50
7.0.250.0080.00915.51
7.0.240.0100.00615.63
7.0.230.0080.01015.56
7.0.220.0070.00415.63
7.0.210.0100.00615.55
7.0.200.0190.00615.26
7.0.190.0080.00615.56
7.0.180.0090.00915.47
7.0.170.0090.00315.49
7.0.160.0060.00815.58
7.0.150.0070.01015.67
7.0.140.0090.00815.43
7.0.130.0110.00615.58
7.0.120.0100.00515.63
7.0.110.0080.00915.59
7.0.100.0080.00715.57
7.0.90.0120.00415.48
7.0.80.0090.00715.41
7.0.70.0150.02116.64
7.0.60.0170.01716.61
7.0.50.0160.02216.72
7.0.40.0150.02015.66
7.0.30.0140.02515.76
7.0.20.0170.01815.71
7.0.10.0160.02115.76
7.0.00.0150.02215.78
5.6.400.0010.01014.49
5.6.390.0050.00714.60
5.6.380.0060.00714.63
5.6.370.0090.00714.39
5.6.360.0070.01114.62
5.6.350.0060.00914.41
5.6.340.0080.01014.35
5.6.330.0080.00714.33
5.6.320.0070.01014.59
5.6.310.0090.00614.69
5.6.300.0040.01214.71
5.6.290.0080.00814.55
5.6.280.0100.02116.10
5.6.270.0050.01014.38
5.6.260.0070.00714.54
5.6.250.0110.00414.53
5.6.240.0090.00814.58
5.6.230.0060.00814.73
5.6.220.0160.01815.97
5.6.210.0140.02016.05
5.6.200.0140.02016.08
5.6.190.0140.02016.12
5.6.180.0120.01716.14
5.6.170.0110.02316.08
5.6.160.0140.02016.17
5.6.150.0140.02116.10
5.6.140.0130.01916.20
5.6.130.0130.02216.06
5.6.120.0120.01816.20
5.6.110.0140.01716.12
5.6.100.0040.02316.23
5.6.90.0140.02916.14
5.6.80.0150.02016.00
5.6.70.0150.01715.91
5.6.60.0150.01715.93
5.6.50.0160.02015.92
5.6.40.0170.02416.04
5.6.30.0120.02315.94
5.6.20.0140.01815.93
5.6.10.0120.02015.96
5.6.00.0140.01915.80
5.5.380.0030.01211.52
5.5.370.0050.01410.95
5.5.360.0180.03115.84
5.5.350.0200.03215.79
5.5.340.0130.04015.95
5.5.330.0280.02616.09
5.5.320.0140.03215.89
5.5.310.0270.02615.89
5.5.300.0150.03816.08
5.5.290.0230.03515.96
5.5.280.0090.03616.06
5.5.270.0180.02616.18
5.5.260.0140.03415.95
5.5.250.0220.03115.96
5.5.240.0240.02715.84
5.5.230.0220.02815.78
5.5.220.0190.03115.83
5.5.210.0190.04115.81
5.5.200.0190.03215.82
5.5.190.0230.03015.60
5.5.180.0240.03715.68
5.5.170.0070.01414.18
5.5.160.0270.02515.64
5.5.150.0190.03015.78
5.5.140.0180.03515.59
5.5.130.0190.02915.53
5.5.120.0180.03015.73
5.5.110.0180.03015.70
5.5.100.0190.03115.74
5.5.90.0260.02015.71
5.5.80.0070.03215.59
5.5.70.0100.03215.71
5.5.60.0220.02515.70
5.5.50.0210.02815.69
5.5.40.0230.02915.61
5.5.30.0210.02815.58
5.5.20.0250.02515.60
5.5.10.0260.02815.44
5.5.00.0260.02515.74
5.4.450.0130.00311.10
5.4.440.0180.00011.09
5.4.430.0100.00711.15
5.4.420.0140.00311.24
5.4.410.0110.00711.14
5.4.400.0090.00511.27
5.4.390.0050.00911.17
5.4.380.0110.00410.98
5.4.370.0090.00610.98
5.4.360.0110.00611.11
5.4.350.0080.00511.11
5.4.340.0130.00311.13
5.4.330.0100.00310.96
5.4.320.0110.00611.14
5.4.310.0100.00311.11
5.4.300.0070.00711.15
5.4.290.0130.00010.82
5.4.280.0110.00411.36
5.4.270.0030.01010.85
5.4.260.0100.00511.11
5.4.250.0100.00511.14
5.4.240.0070.01011.29
5.4.230.0150.00311.42
5.4.220.0070.00711.10
5.4.210.0110.00411.16
5.4.200.0170.00010.93
5.4.190.0060.00611.08
5.4.180.0110.00411.07
5.4.170.0070.00711.13
5.4.160.0120.00211.41
5.4.150.0050.01011.38
5.4.140.0130.00010.95
5.4.130.0060.00810.93
5.4.120.0090.00610.97
5.4.110.0060.00911.26
5.4.100.0090.00611.52
5.4.90.0100.00311.02
5.4.80.0080.00511.32
5.4.70.0050.00910.93
5.4.60.0060.00910.90
5.4.50.0090.00310.99
5.4.40.0040.01311.14
5.4.30.0070.00711.21
5.4.20.0120.00011.36
5.4.10.0100.00311.02
5.4.00.0090.00311.20
5.3.290.0000.01210.75
5.3.280.0120.00010.62
5.3.270.0110.00410.45
5.3.260.0110.00510.51
5.3.250.0120.00410.52
5.3.240.0080.00510.27
5.3.230.0090.00910.45
5.3.220.0070.00710.62
5.3.210.0100.00210.48
5.3.200.0070.00710.51
5.3.190.0120.00310.66
5.3.180.0080.00810.63
5.3.170.0100.00510.74
5.3.160.0110.00310.78
5.3.150.0160.00010.79
5.3.140.0040.01210.63
5.3.130.0050.00810.65
5.3.120.0140.00010.62
5.3.110.0090.00310.44
5.3.100.0060.00610.63
5.3.90.0130.00010.68
5.3.80.0090.00510.44
5.3.70.0110.00510.57
5.3.60.0150.00010.61
5.3.50.0000.01310.43
5.3.40.0080.00410.58
5.3.30.0100.00610.37
5.3.20.0100.00310.60
5.3.10.0040.01110.47
5.3.00.0090.00910.45
5.2.170.0120.0009.25
5.2.160.0060.0069.10
5.2.150.0060.0069.13
5.2.140.0080.0039.02
5.2.130.0000.0129.27
5.2.120.0110.0049.37
5.2.110.0080.0039.13
5.2.100.0080.0059.36
5.2.90.0060.0069.00
5.2.80.0080.0049.23
5.2.70.0050.0059.01
5.2.60.0040.0089.24
5.2.50.0090.0039.08
5.2.40.0070.0079.30
5.2.30.0000.0119.15
5.2.20.0060.0039.09
5.2.10.0080.0048.91
5.2.00.0060.0068.99
5.1.60.0070.0038.31
5.1.50.0030.0068.04
5.1.40.0050.0058.39
5.1.30.0040.0078.39
5.1.20.0070.0058.29
5.1.10.0040.0048.32
5.1.00.0050.0058.28
5.0.50.0060.0007.54
5.0.40.0090.0007.54
5.0.30.0080.0037.54
5.0.20.0040.0047.54
5.0.10.0000.0077.54
5.0.00.0060.0037.54
4.4.90.0050.0027.54
4.4.80.0060.0007.54
4.4.70.0030.0037.54
4.4.60.0060.0007.54
4.4.50.0050.0037.54
4.4.40.0030.0037.54
4.4.30.0030.0077.54
4.4.20.0070.0007.54
4.4.10.0070.0007.54
4.4.00.0040.0047.54
4.3.110.0040.0027.54
4.3.100.0000.0057.54
4.3.90.0070.0007.54
4.3.80.0000.0077.54
4.3.70.0030.0077.54
4.3.60.0050.0027.54
4.3.50.0040.0047.54
4.3.40.0070.0007.54
4.3.30.0060.0007.54
4.3.20.0000.0057.54
4.3.10.0000.0067.54
4.3.00.0030.0037.54

preferences:
33.47 ms | 403 KiB | 5 Q