3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.0.0 - 7.0.3, 7.0.5 - 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known 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 failed: Name or service not known 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.
Output for 7.0.4
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 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.
Output for hhvm-3.10.0 - 3.12.0
Warning: Failed to open http://www.yelp.com/biz/franchino-san-francisco?start=80 (Could not resolve host: www.yelp.com) in /in/bIKC7 on line 2 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function getAttribute() on a non-object (null)' in /in/bIKC7:29 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.7 - 5.6.17, 5.6.20 - 5.6.28
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known 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 failed: Name or service not known in /in/bIKC7 on line 2 Fatal error: Call to a member function getAttribute() on null in /in/bIKC7 on line 29
Process exited with code 255.
Output for 5.6.18 - 5.6.19
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/bIKC7 on line 2 Fatal error: Call to a member function getAttribute() on null in /in/bIKC7 on line 29
Process exited with code 255.
Output for 5.3.29, 5.4.28 - 5.4.41, 5.5.24 - 5.5.32, 5.5.34 - 5.5.35
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known 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 failed: Name or service not known in /in/bIKC7 on line 2 Fatal error: Call to a member function getAttribute() on a non-object in /in/bIKC7 on line 29
Process exited with code 255.
Output for 5.2.6 - 5.3.28, 5.4.0 - 5.4.27, 5.4.42 - 5.4.45, 5.5.33
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/bIKC7 on line 2 Fatal error: Call to a member function getAttribute() on a non-object in /in/bIKC7 on line 29
Process exited with code 255.
Output for 5.0.3 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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: Connection refused in /in/bIKC7 on line 2 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/bIKC7 on line 9 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/bIKC7 on line 20 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/bIKC7 on line 28
Process exited with code 255.
Output for 5.0.1 - 5.0.2
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/bIKC7 on line 2 Warning: file_get_contents(http://www.yelp.com/biz/franchino-san-francisco?start=80): failed to open stream: Resource temporarily unavailable in /in/bIKC7 on line 2 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/bIKC7 on line 9 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/bIKC7 on line 20 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/bIKC7 on line 28
Process exited with code 255.
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/bIKC7 on line 2 Warning: file_get_contents(http://www.yelp.com/biz/franchino-san-francisco?start=80): failed to open stream: Bad file descriptor in /in/bIKC7 on line 2 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/bIKC7 on line 9 Warning: DOMDocument::loadHTML(): Empty string supplied as input in /in/bIKC7 on line 20 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/bIKC7 on line 28
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/bIKC7 on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/bIKC7 on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/bIKC7 on line 14
Process exited with code 255.