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"; }
Output for git.master, git.master_jit, rfc.property-hooks
The height integer: 210 The width integer: 295 --- The height integer: 420 The width integer: 590 ---

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
25.49 ms | 405 KiB | 5 Q