3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<span class="ui_bubble_rating bubble_45"></span>'; $doc = new DOMDocument(); $doc->loadHTML($html); $xp = new DOMXPath($doc); $ratingsElements = $xp->query('//span[contains(concat(" ", normalize-space(@class), " "), " ui_bubble_rating ")]'); if ($ratingsElements->length > 0) { $firstRatingElement = $ratingsElements->item(0); if (preg_match('/(?<=\bbubble_)\d+/', $firstRatingElement->getAttribute('class'), $matches)) { echo $matches[0]; // 45 } }
Output for git.master, git.master_jit, rfc.property-hooks
45

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.84 ms | 405 KiB | 5 Q