3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <a class="c-shadow" href="some-random-link">text 1</a> <a class="c-shadow" href="some-random-link">text 2</a> <a class="c-shadow" href="some-random-link">text 3</a> <a class="c-shadow" href="some-random-link">text 4</a> <a class="c-shadow" href="some-random-link">text 5</a> HTML; $dom=new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); foreach ($xpath->evaluate("//a[@class='c-shadow']") as $node) { $result[]=$node->nodeValue; } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'text 1', 1 => 'text 2', 2 => 'text 3', 3 => 'text 4', 4 => 'text 5', )

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