3v4l.org

run code in 300+ PHP versions simultaneously
<?php $current_path = 'http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656'; $social_share = array("http://graph.facebook.com/?id=", "http://cdn.api.twitter.com/1/urls/count.json?url=","http://api.pinterest.com/v1/urls/count.json?callback=jsonp&url=", "https://plusone.google.com/_/+1/fastbutton?url="); $share = 0; foreach($social_share as $social) { $url = $social. $current_path; $json_output = file_get_contents($url, TRUE); $json = json_decode($json_output, TRUE); if($social == "http://graph.facebook.com/?id="){ $share += $json['shares']; } elseif($social == "https://plusone.google.com/_/+1/fastbutton?url="){ $doc = new DOMDocument(); @$doc->loadHTML($json_output); $counter=$doc->getElementById('aggregateCount'); $share += $counter->nodue; } else{ $share += $json['count']; } } print $share;
Output for git.master, git.master_jit
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for graph.facebook.com failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(http://graph.facebook.com/?id=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656): Failed to open stream: php_network_getaddresses: getaddrinfo for graph.facebook.com failed: System error in /in/H66Dl on line 8 Warning: Trying to access array offset on value of type null in /in/H66Dl on line 11 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for cdn.api.twitter.com failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(http://cdn.api.twitter.com/1/urls/count.json?url=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656): Failed to open stream: php_network_getaddresses: getaddrinfo for cdn.api.twitter.com failed: System error in /in/H66Dl on line 8 Warning: Trying to access array offset on value of type null in /in/H66Dl on line 20 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for api.pinterest.com failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(http://api.pinterest.com/v1/urls/count.json?callback=jsonp&url=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656): Failed to open stream: php_network_getaddresses: getaddrinfo for api.pinterest.com failed: System error in /in/H66Dl on line 8 Warning: Trying to access array offset on value of type null in /in/H66Dl on line 20 Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/H66Dl on line 8 Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/H66Dl on line 8 Warning: file_get_contents(): open_basedir restriction in effect. File(https://plusone.google.com/_/+1/fastbutton?url=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H66Dl on line 8 Warning: file_get_contents(https://plusone.google.com/_/+1/fastbutton?url=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656): Failed to open stream: Operation not permitted in /in/H66Dl on line 8 Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /in/H66Dl:14 Stack trace: #0 /in/H66Dl(14): DOMDocument->loadHTML('') #1 {main} thrown in /in/H66Dl on line 14
Process exited with code 255.
Output for rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for graph.facebook.com failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(http://graph.facebook.com/?id=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656): Failed to open stream: php_network_getaddresses: getaddrinfo for graph.facebook.com failed: System error in /in/H66Dl on line 8 Warning: Trying to access array offset on null in /in/H66Dl on line 11 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for cdn.api.twitter.com failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(http://cdn.api.twitter.com/1/urls/count.json?url=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656): Failed to open stream: php_network_getaddresses: getaddrinfo for cdn.api.twitter.com failed: System error in /in/H66Dl on line 8 Warning: Trying to access array offset on null in /in/H66Dl on line 20 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for api.pinterest.com failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(http://api.pinterest.com/v1/urls/count.json?callback=jsonp&url=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656): Failed to open stream: php_network_getaddresses: getaddrinfo for api.pinterest.com failed: System error in /in/H66Dl on line 8 Warning: Trying to access array offset on null in /in/H66Dl on line 20 Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/H66Dl on line 8 Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/H66Dl on line 8 Warning: file_get_contents(): open_basedir restriction in effect. File(https://plusone.google.com/_/+1/fastbutton?url=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656) is not within the allowed path(s): (/tmp:/in:/etc) in /in/H66Dl on line 8 Warning: file_get_contents(https://plusone.google.com/_/+1/fastbutton?url=http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656): Failed to open stream: Operation not permitted in /in/H66Dl on line 8 Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /in/H66Dl:14 Stack trace: #0 /in/H66Dl(14): DOMDocument->loadHTML('') #1 {main} thrown in /in/H66Dl on line 14
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:
66.43 ms | 403 KiB | 8 Q