3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<!doctype html><html><body> <div class="item"> <span class="showcase-item-name showcase-item-brand">Name</span> <a href="/link/here">Click me</a> <span class="price-value">R$ 1,2.3</span> </div> </body></html> '; $dom = Dom\HTMLDocument::createFromString($html); foreach ($dom->querySelectorAll("div.item") as $item) { var_dump($item->querySelector("span.showcase-item-brand")->textContent); var_dump($item->querySelector("a[href]")->getAttribute("href")); var_dump($item->querySelector("span.price-value")->textContent); }
Output for git.master_jit, git.master
string(4) "Name" string(10) "/link/here" string(8) "R$ 1,2.3"

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:
77.62 ms | 405 KiB | 5 Q