3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html_string = '<!DOCTYPE html> <html> <body> <div id="foo"> This is a paragraph with <strong>Some nested tags</strong> </div> <div class="test" id="bar"> <div> And a nested div? </div> </div> <div class="baz test"> <p> Pretty normal HTML. </p> </div> </body> </html>'; $regex = '/<div[^>]*?(class="(.+?)"[^>]*)?>((?:.*?(?:(?!<div)|(?R))*)*)' . '<\/div>/sm'; if (preg_match_all($regex, $html_string, $matches, PREG_SET_ORDER)) { var_dump($matches); }

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.0040.01118.56
8.3.50.0050.01222.17
8.3.40.0110.00718.79
8.3.30.0110.00418.92
8.3.20.0040.00420.39
8.3.10.0000.00823.70
8.3.00.0040.00419.56
8.2.180.0110.00716.38
8.2.170.0080.00822.96
8.2.160.0070.00720.23
8.2.150.0000.00924.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00021.28
8.2.110.0090.00022.38
8.2.100.0090.00317.91
8.2.90.0050.00317.84
8.2.80.0040.00417.97
8.2.70.0050.00517.75
8.2.60.0040.00418.04
8.2.50.0030.00718.07
8.2.40.0040.00418.22
8.2.30.0080.00018.23
8.2.20.0000.00817.90
8.2.10.0000.00817.96
8.2.00.0000.00717.85
8.1.280.0070.00725.92
8.1.270.0090.00023.86
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0050.00522.29
8.1.230.0090.00420.88
8.1.220.0080.00017.74
8.1.210.0030.00518.89
8.1.200.0060.00317.47
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0030.00618.70
8.1.160.0020.00522.05
8.1.150.0000.00818.90
8.1.140.0040.00417.57
8.1.130.0070.00017.86
8.1.120.0000.00717.50
8.1.110.0000.00817.54
8.1.100.0080.00017.58
8.1.90.0000.00717.40
8.1.80.0000.00817.60
8.1.70.0030.00317.45
8.1.60.0000.00917.74
8.1.50.0030.00617.61
8.1.40.0000.00817.61
8.1.30.0030.00617.77
8.1.20.0050.00217.81
8.1.10.0030.00617.59
8.1.00.0020.00517.50
8.0.300.0080.00019.75
8.0.290.0000.00816.61
8.0.280.0040.00418.42
8.0.270.0040.00417.25
8.0.260.0000.00817.29
8.0.250.0030.00317.07
8.0.240.0000.00716.98
8.0.230.0040.00417.11
8.0.220.0030.00316.96
8.0.210.0020.00516.98
8.0.200.0030.00317.10
8.0.190.0080.00417.05
8.0.180.0080.00016.96
8.0.170.0090.00017.05
8.0.160.0040.00416.94
8.0.150.0040.00416.94
8.0.140.0030.00516.96
8.0.130.0060.00013.43
8.0.120.0000.00816.82
8.0.110.0040.00416.96
8.0.100.0050.00216.86
8.0.90.0040.00416.97
8.0.80.0040.01116.99
8.0.70.0000.00817.04
8.0.60.0040.00417.02
8.0.50.0040.00416.88
8.0.30.0080.01517.19
8.0.20.0090.01017.41
8.0.10.0040.00416.94
8.0.00.0090.00916.79
7.4.330.0030.00315.12
7.4.320.0030.00316.69
7.4.300.0060.00016.75
7.4.290.0000.00716.60
7.4.280.0030.00316.66
7.4.270.0040.00416.75
7.4.260.0070.00016.57
7.4.250.0000.00816.64
7.4.240.0020.00516.67
7.4.230.0000.00816.48
7.4.220.0080.01216.62
7.4.210.0100.00616.86
7.4.200.0000.00716.67
7.4.160.0130.00316.57
7.4.150.0110.01417.40
7.4.140.0110.00817.86
7.4.130.0150.00816.67
7.4.120.0110.00616.77
7.4.110.0090.01216.62
7.4.100.0110.00716.66
7.4.90.0110.00816.59
7.4.80.0180.00619.39
7.4.70.0100.00716.56
7.4.60.0100.01016.61
7.4.50.0040.00416.64
7.4.40.0090.00916.71
7.4.30.0080.00816.80
7.4.00.0030.00815.13
7.3.330.0060.00013.05
7.3.320.0020.00213.17
7.3.310.0030.00316.18
7.3.300.0070.00016.27
7.3.290.0090.00616.43
7.3.280.0070.01116.34
7.3.270.0190.00617.40
7.3.260.0090.00916.30
7.3.250.0050.01316.26
7.3.240.0070.01016.38
7.3.230.0070.01316.39
7.3.210.0100.00716.53
7.3.200.0060.00919.39
7.3.190.0070.01716.63
7.3.180.0110.00716.74
7.3.170.0100.00716.61
7.3.160.0030.01316.60
7.3.120.0060.01114.79
7.2.330.0120.00616.60
7.2.320.0110.01116.84
7.2.310.0090.00916.61
7.2.300.0120.00616.83
7.2.290.0090.00916.47
7.2.60.0050.01017.05
7.2.00.0040.01119.19
7.1.200.0000.01215.95
7.1.100.0060.00918.16
7.1.70.0030.00317.15
7.1.60.0130.00019.70
7.1.50.0150.00917.11
7.1.00.0000.08022.48
7.0.200.0030.00516.68
7.0.140.0030.06722.10
7.0.60.0100.07720.09
7.0.50.0100.06017.70
7.0.40.0070.05320.25
7.0.30.0500.07020.22
7.0.20.0200.05720.04
7.0.10.0000.04720.07
7.0.00.0170.06320.23
5.6.280.0000.07721.20
5.6.210.0030.07020.63
5.6.200.0030.05018.37
5.6.190.0070.06020.77
5.6.180.3130.04320.65
5.6.170.0270.06320.44
5.6.160.0030.04320.64
5.6.150.0100.08018.35
5.6.140.0100.04718.32
5.6.130.0000.04318.34
5.6.120.0000.04321.12
5.6.110.0100.03321.25
5.6.100.0100.07021.01
5.6.90.0100.08021.06
5.6.80.0170.06320.51
5.6.70.0330.07320.63
5.5.350.0070.07020.46
5.5.340.0070.06718.15
5.5.330.0100.08020.52
5.5.320.0370.04720.34
5.5.310.0270.04720.42
5.5.300.0100.03718.08
5.5.290.0070.08018.18
5.5.280.0130.07020.98
5.5.270.0100.07720.87
5.5.260.0000.04720.89
5.5.250.0100.08720.81
5.5.240.0130.05320.17
5.4.450.0470.04019.26
5.4.440.0330.03719.56
5.4.430.0570.04319.63
5.4.420.0430.04319.55
5.4.410.0430.04319.23
5.4.400.0370.03719.29
5.4.390.0170.03719.23
5.4.380.0230.04718.76
5.4.370.0130.05318.84
5.4.360.0100.05318.83
5.4.350.0100.05718.64
5.4.340.0170.05318.62
5.4.320.0050.03712.61
5.4.310.0060.03812.60
5.4.300.0060.03612.60
5.4.290.0060.03812.60
5.4.280.0080.03312.50
5.4.270.0040.03812.49
5.4.260.0070.04712.49
5.4.250.0040.03912.49
5.4.240.0060.03612.49
5.4.230.0050.03912.48
5.4.220.0050.03712.49
5.4.210.0050.03612.48
5.4.200.0060.03812.48
5.4.190.0070.03512.48
5.4.180.0050.03512.48
5.4.170.0070.03512.49
5.4.160.0070.03412.49
5.4.150.0080.03412.48
5.4.140.0060.04812.17
5.4.130.0060.03612.16
5.4.120.0060.03512.21
5.4.110.0030.04012.21
5.4.100.0070.03412.21
5.4.90.0020.04312.21
5.4.80.0070.03512.22
5.4.70.0090.03912.22
5.4.60.0060.03812.21
5.4.50.0090.03612.22
5.4.40.0070.03812.21
5.4.30.0030.03912.20
5.4.20.0050.03612.20
5.4.10.0070.03512.20
5.4.00.0060.03511.62
5.3.290.0050.04112.87
5.3.280.0070.03612.79
5.3.270.0050.04012.80
5.3.260.0090.04312.80
5.3.250.0100.03412.80
5.3.240.0070.03512.80
5.3.230.0120.03712.80
5.3.220.0060.04012.87
5.3.210.0060.03812.86
5.3.200.0040.04412.86
5.3.190.0070.04212.86
5.3.180.0070.03512.88
5.3.170.0090.03912.87
5.3.160.0030.03912.87
5.3.150.0050.04212.87
5.3.140.0060.03612.87
5.3.130.0090.03512.86
5.3.120.0070.03712.86
5.3.110.0070.04412.86
5.3.100.0100.03212.35
5.3.90.0080.03712.25
5.3.80.0100.03212.25
5.3.70.0030.04112.25
5.3.60.0070.03512.23
5.3.50.0070.03412.18
5.3.40.0080.03412.18
5.3.30.0060.03412.13
5.3.20.0080.03311.91
5.3.10.0090.03111.87
5.3.00.0070.03511.86
5.2.170.0080.0319.36
5.2.160.0040.0299.36
5.2.150.0040.0309.36
5.2.140.0070.0299.36
5.2.130.0020.0319.32
5.2.120.0080.0289.31
5.2.110.0050.0329.32
5.2.100.0030.0299.31
5.2.90.0060.0289.31
5.2.80.0090.0349.30
5.2.70.0050.0329.31
5.2.60.0050.0319.26
5.2.50.0050.0299.23
5.2.40.0090.0239.19
5.2.30.0090.0299.16
5.2.20.0010.0339.15
5.2.10.0060.0268.98
5.2.00.0060.0298.85
5.1.60.0040.0318.17
5.1.50.0040.0258.16
5.1.40.0030.0398.15
5.1.30.0050.0258.50
5.1.20.0040.0328.52
5.1.10.0040.0258.24
5.1.00.0040.0248.24
5.0.50.0030.0296.72
5.0.40.0050.0176.57
5.0.30.0030.0356.38
5.0.20.0020.0216.36
5.0.10.0040.0196.33
5.0.00.0030.0406.32
4.4.90.0030.0164.81
4.4.80.0080.0154.77
4.4.70.0030.0154.75
4.4.60.0060.0184.76
4.4.50.0040.0174.77
4.4.40.0020.0264.73
4.4.30.0070.0174.76
4.4.20.0040.0194.85
4.4.10.0040.0184.85
4.4.00.0010.0284.76
4.3.110.0030.0214.67
4.3.100.0030.0154.67
4.3.90.0050.0154.64
4.3.80.0010.0264.62
4.3.70.0030.0204.63
4.3.60.0040.0214.63
4.3.50.0020.0154.63
4.3.40.0050.0294.57
4.3.30.0040.0153.38
4.3.20.0010.0173.35
4.3.10.0010.0203.31
4.3.00.0070.01714.50

preferences:
59.58 ms | 401 KiB | 5 Q