3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA <p>a lot of some html code here</p> <p class="price"> <strong>2680 $</strong> <div>a lot of some random html code here</div> <p class="price"> <strong>3250 $</strong> <p>a lot of some good html code here</p> <p class="price"> <strong>3450 $</strong> <div id="promoted-after"></div> <p class="price"> <strong>400 $</strong> <td>a lot of some strange html code here</td> <p class="price"> <strong>401 $</strong> <div>a lot of some awesome html code here</div> <p class="price"> <strong>402 $</strong> <span>a lot of some ugly html code here</span> <p class="price"> <strong>403 $</strong> <div>a lot of some nice html code here</div> <p class="price"> <strong>404 $</strong> <table>a lot of some best html code here</table> DATA; $dom = new DOMDocument(); $dom->loadHTML($data); $xpath = new DOMXPath($dom); $items = $xpath->query('//div[@id="promoted-after"]/following-sibling::p/strong'); foreach($items as $item) { echo $item->nodeValue . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
400 $ 401 $ 402 $ 403 $ 404 $

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