3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error 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: php_network_getaddresses: getaddrinfo failed: System error in /in/H66Dl on line 8 Notice: Trying to get property 'nodue' of non-object in /in/H66Dl on line 16 0
Output for 5.4.15 - 5.4.19, 5.4.21 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4, 7.0.20, 7.1.5 - 7.1.10
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error 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: php_network_getaddresses: getaddrinfo failed: System error in /in/H66Dl on line 8 Notice: Trying to get property of non-object in /in/H66Dl on line 16 0
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known 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 failed: Name or service not known in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known 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 failed: Name or service not known in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known 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 failed: Name or service not known in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known 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: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/H66Dl on line 8 Notice: Trying to get property of non-object in /in/H66Dl on line 16 0
Output for 5.3.0 - 5.4.14, 5.4.20
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error 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(): 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(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: No such file or directory in /in/H66Dl on line 8 Notice: Trying to get property of non-object in /in/H66Dl on line 16 0
Output for 5.2.6 - 5.2.17
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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 failed: System error in /in/H66Dl on line 8 Notice: 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(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: No such file or directory in /in/H66Dl on line 8 Notice: Trying to get property of non-object in /in/H66Dl on line 16 0
Output for 5.2.0 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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: Connection refused in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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: Connection refused in /in/H66Dl on line 8 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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: Connection refused in /in/H66Dl on line 8 Notice: 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(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: No such file or directory in /in/H66Dl on line 8 Notice: Trying to get property of non-object in /in/H66Dl on line 16 0
Output for 5.0.3 - 5.1.6
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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: Connection refused in /in/H66Dl on line 8 Fatal error: Call to undefined function json_decode() in /in/H66Dl on line 9
Process exited with code 255.
Output for 5.0.1 - 5.0.2
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed 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: Resource temporarily unavailable in /in/H66Dl on line 8 Fatal error: Call to undefined function json_decode() in /in/H66Dl on line 9
Process exited with code 255.
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed 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: Bad file descriptor in /in/H66Dl on line 8 Fatal error: Call to undefined function json_decode() in /in/H66Dl on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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: Connection refused in /in/H66Dl on line 8 Fatal error: Call to undefined function: json_decode() in /in/H66Dl on line 9
Process exited with code 255.
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.4.4
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo 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: Connection refused in /in/H66Dl on line 8 Fatal error: Call to undefined function: json_decode() in /in/H66Dl on line 9
Process exited with code 255.
Output for 4.3.5 - 4.3.9
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed 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: Resource temporarily unavailable in /in/H66Dl on line 8 Fatal error: Call to undefined function: json_decode() in /in/H66Dl on line 9
Process exited with code 255.
Output for 4.3.2
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) 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: Connection refused in /in/H66Dl on line 8 Fatal error: Call to undefined function: json_decode() in /in/H66Dl on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: file_get_contents() [http://www.php.net/function.file-get-contents]: php_network_getaddresses: getaddrinfo 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) [http://www.php.net/function.file-get-contents]: failed to create stream: Connection refused in /in/H66Dl on line 8 Fatal error: Call to undefined function: json_decode() in /in/H66Dl on line 9