3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html= file_get_contents('http://www.yelp.com/biz/franchino-san-francisco?start=80'); $html = escapeshellarg($html) ; $html = nl2br($html); $classname = 'rating-qualifier'; $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $results = $xpath->query("//*[@class='" . $classname . "']"); if ($results->length > 0) { echo $review = $results->item(0)->nodeValue; } $classname = 'review_comment ieSucks'; $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $results = $xpath->query("//*[@class='" . $classname . "']"); if ($results->length > 0) { echo $review = $results->item(0)->nodeValue; } $meta = $dom->documentElement->getElementsByTagName("meta"); echo $meta->item(0)->getAttribute('content'); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for www.yelp.com failed: System error in /in/bIKC7 on line 2 Warning: file_get_contents(http://www.yelp.com/biz/franchino-san-francisco?start=80): Failed to open stream: php_network_getaddresses: getaddrinfo for www.yelp.com failed: System error in /in/bIKC7 on line 2 Fatal error: Uncaught Error: Call to a member function getAttribute() on null in /in/bIKC7:29 Stack trace: #0 {main} thrown in /in/bIKC7 on line 29
Process exited with code 255.

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:
39.38 ms | 402 KiB | 8 Q