3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div class="items"> <div class="item" title="Checking for bad parsing. height:666px; width:666px;" style="width:295px; height:210px; border:1px solid #000;"></div> <div></div> <div class="item" style="line-height:14pt; border:1px solid #000; height :420px; width: 590px;"></div> </div> HTML; $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXpath($dom); foreach ($xpath->query('//div[@class="item"]/@style') as $node) { $style = $node->nodeValue; echo "The height integer: " , preg_match('~(?:^|;)\s*height\s*:\s*\K\d+~', $style, $h) ? $h[0] : ''; echo "\n"; echo "The width integer: " , preg_match('~(?:^|;)\s*width\s*:\s*\K\d+~', $style, $w) ? $w[0] : ''; echo "\n---\n"; }

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.120.0100.01220.65
8.4.110.0060.00319.43
8.4.100.0150.00720.19
8.4.90.0120.00819.04
8.4.80.0040.00520.08
8.4.70.0150.00818.51
8.4.60.0100.00719.03
8.4.50.0040.00519.05
8.4.40.0060.00320.27
8.4.30.0090.00019.09
8.4.20.0160.00618.35
8.4.10.0150.00319.75
8.3.250.0100.00919.39
8.3.240.0120.00817.05
8.3.230.0120.00517.16
8.3.220.0130.00717.63
8.3.210.0080.01118.73
8.3.200.0040.00517.06
8.3.190.0070.00117.55
8.3.180.0130.00618.55
8.3.170.0060.01321.02
8.3.160.0090.00920.85
8.3.150.0070.01317.74
8.3.140.0110.00017.53
8.3.130.0040.00418.89
8.3.120.0080.00021.41
8.3.110.0080.00318.87
8.3.100.0040.00417.33
8.3.90.0000.01826.77
8.3.80.0060.00318.93
8.3.70.0060.01017.13
8.3.60.0090.00617.13
8.3.50.0090.00823.96
8.3.40.0090.00919.37
8.3.30.0130.00319.17
8.3.20.0050.00321.07
8.3.10.0000.00824.04
8.3.00.0090.00022.21
8.2.290.0150.00420.71
8.2.280.0100.00920.49
8.2.270.0110.00819.41
8.2.260.0180.00017.36
8.2.250.0160.00316.98
8.2.240.0060.00919.31
8.2.230.0070.00320.94
8.2.220.0130.00324.06
8.2.210.0080.00026.77
8.2.200.0040.00717.00
8.2.190.0130.00719.04
8.2.180.0180.00425.92
8.2.170.0120.00322.96
8.2.160.0070.01021.56
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00226.16
8.2.110.0090.00019.77
8.2.100.0090.00318.18
8.2.90.0000.01018.25
8.2.80.0030.00519.58
8.2.70.0050.00518.13
8.2.60.0060.00318.18
8.2.50.0030.00518.09
8.2.40.0000.00818.85
8.2.30.0000.00818.53
8.2.20.0040.00418.36
8.2.10.0040.00419.79
8.2.00.0030.00619.70
8.1.330.0120.01022.18
8.1.320.0150.00516.82
8.1.310.0040.00419.08
8.1.300.0030.00620.69
8.1.290.0090.00030.84
8.1.280.0070.00725.92
8.1.270.0030.00624.36
8.1.260.0100.00026.35
8.1.250.0040.00428.09
8.1.240.0050.00521.30
8.1.230.0090.00318.20
8.1.220.0030.00618.16
8.1.210.0060.00318.77
8.1.200.0000.00917.86
8.1.190.0080.00017.85
8.1.180.0060.00318.10
8.1.170.0060.00319.41
8.1.160.0000.00819.22
8.1.150.0040.00419.21
8.1.140.0000.00821.12
8.1.130.0060.00320.65
8.1.120.0000.01017.98
8.1.110.0000.01017.84
8.1.100.0030.00618.01
8.1.90.0040.00417.91
8.1.80.0040.00417.83
8.1.70.0000.00717.90
8.1.60.0030.00618.04
8.1.50.0060.00617.97
8.1.40.0000.00917.91
8.1.30.0040.00417.99
8.1.20.0090.00018.21
8.1.10.0030.00518.00
8.1.00.0090.00017.99
8.0.300.0070.00418.77
8.0.290.0080.00017.50
8.0.280.0070.00018.83
8.0.270.0030.00318.45
8.0.260.0070.00020.34
8.0.250.0070.00017.55
8.0.240.0000.00817.42
8.0.230.0070.00017.50
8.0.220.0000.00717.49
8.0.210.0030.00317.33
8.0.200.0020.00517.56
8.0.190.0060.00317.42
8.0.180.0000.00917.34
8.0.170.0000.00917.33
8.0.160.0040.00417.44
8.0.150.0030.00517.41
8.0.140.0040.00417.45
8.0.130.0030.00313.93
8.0.120.0030.00617.42
8.0.110.0070.00017.25
8.0.100.0040.00417.25
8.0.90.0060.00317.60
8.0.80.0110.00717.52
8.0.70.0040.00417.51
8.0.60.0030.00517.43
8.0.50.0050.00317.54
8.0.30.0130.00617.63
8.0.20.0130.00717.59
8.0.10.0000.00817.63
8.0.00.0060.01217.53
7.4.330.0060.00017.03
7.4.320.0000.00617.07
7.4.300.0040.00417.02
7.4.290.0040.00417.11
7.4.280.0060.00317.02
7.4.270.0000.00717.06
7.4.260.0030.00313.82
7.4.250.0040.00417.14
7.4.240.0050.00217.03
7.4.230.0030.00417.27
7.4.220.0040.00417.13
7.4.210.0080.00617.17
7.4.200.0080.00017.23
7.4.130.0070.01117.03
7.4.120.0150.00717.14
7.4.110.0140.00417.18
7.4.100.0200.00317.00
7.4.90.0120.00617.02
7.4.80.0110.00519.39
7.4.70.0060.00917.04
7.4.60.0090.00916.99
7.4.50.0060.00917.14
7.4.40.0100.00717.32
7.4.20.0110.01416.85
7.4.10.0110.00716.77
7.4.00.0090.00916.98
7.3.330.0040.00416.84
7.3.320.0000.00613.65
7.3.310.0070.00016.87
7.3.300.0000.00716.80
7.3.290.0090.00916.74
7.3.260.0100.01316.73
7.3.240.0100.00716.92
7.3.230.0100.00716.84
7.3.210.0060.01116.72
7.3.200.0080.01617.08
7.3.190.0070.01117.01
7.3.180.0100.00716.98
7.3.170.0100.00616.80
7.3.160.0150.00316.83
7.3.140.0110.00816.89
7.3.130.0120.01216.78
7.3.120.0070.01316.67
7.3.110.0090.00916.54
7.3.100.0150.00416.99
7.3.90.0160.00816.72
7.3.80.0080.01116.66
7.3.70.0060.01216.55
7.3.60.0060.01216.74
7.3.50.0110.00716.80
7.3.40.0160.00816.77
7.3.30.0070.01016.63
7.3.20.0060.01216.59
7.3.10.0050.01216.64
7.3.00.0110.00716.54
7.2.330.0090.01817.23
7.2.320.0080.01117.23
7.2.310.0150.00417.33
7.2.300.0090.00917.27
7.2.290.0130.00717.05
7.2.270.0150.00917.26
7.2.260.0040.01617.01
7.2.250.0080.01117.14
7.2.240.0100.01416.90
7.2.230.0130.01017.04
7.2.220.0130.01317.06
7.2.210.0090.01017.02
7.2.200.0100.01016.89
7.2.190.0050.01317.06
7.2.180.0120.00817.01
7.2.170.0090.01316.75
7.2.160.0000.01716.92
7.2.150.0130.00616.85
7.2.140.0060.01217.05
7.2.130.0160.00316.94
7.2.120.0110.00716.95
7.2.110.0060.01217.04
7.2.100.0090.01016.94
7.2.90.0100.01317.00
7.2.80.0060.01216.82
7.2.70.0110.00717.08
7.2.60.0160.00317.09
7.2.50.0070.01117.05
7.2.40.0080.01116.79
7.2.30.0080.01117.27
7.2.20.0130.00617.05
7.2.10.0100.01016.99
7.2.00.0070.01017.01

preferences:
116.38 ms | 403 KiB | 5 Q