3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = "http://t0.gstatic.com/images?q=tbn:ANd9GcRJKXYLKY7mIU6i2xLRG7Az9Ze2QbpwiJ50IHaOWbB6K8wLSClwf0WAp5FQ1g"; echo "<pre>"; print_r(get_headers($url)); print_r(get_headers_curl($url)); function get_headers_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 15); $r = curl_exec($ch); $r = explode("\n", $r); return $r; } ?>
Output for 7.0.0 - 7.1.0
<pre> Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/RXp0e on line 5 Warning: get_headers(http://t0.gstatic.com/images?q=tbn:ANd9GcRJKXYLKY7mIU6i2xLRG7Az9Ze2QbpwiJ50IHaOWbB6K8wLSClwf0WAp5FQ1g): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/RXp0e on line 5 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/RXp0e:10 Stack trace: #0 /in/RXp0e(6): get_headers_curl('http://t0.gstat...') #1 {main} thrown in /in/RXp0e on line 10
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
<pre>Array ( [0] => )
Output for 5.2.6 - 5.6.28
<pre> Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/RXp0e on line 5 Warning: get_headers(http://t0.gstatic.com/images?q=tbn:ANd9GcRJKXYLKY7mIU6i2xLRG7Az9Ze2QbpwiJ50IHaOWbB6K8wLSClwf0WAp5FQ1g): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/RXp0e on line 5 Fatal error: Call to undefined function curl_init() in /in/RXp0e on line 10
Process exited with code 255.
Output for 5.0.3 - 5.2.5
<pre> Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/RXp0e on line 5 Warning: get_headers(http://t0.gstatic.com/images?q=tbn:ANd9GcRJKXYLKY7mIU6i2xLRG7Az9Ze2QbpwiJ50IHaOWbB6K8wLSClwf0WAp5FQ1g): failed to open stream: Connection refused in /in/RXp0e on line 5 Fatal error: Call to undefined function curl_init() in /in/RXp0e on line 10
Process exited with code 255.
Output for 5.0.1 - 5.0.2
<pre> Warning: get_headers(): php_network_getaddresses: gethostbyname failed in /in/RXp0e on line 5 Warning: get_headers(http://t0.gstatic.com/images?q=tbn:ANd9GcRJKXYLKY7mIU6i2xLRG7Az9Ze2QbpwiJ50IHaOWbB6K8wLSClwf0WAp5FQ1g): failed to open stream: Success in /in/RXp0e on line 5 Fatal error: Call to undefined function curl_init() in /in/RXp0e on line 10
Process exited with code 255.
Output for 5.0.0
<pre> Warning: get_headers(): php_network_getaddresses: gethostbyname failed in /in/RXp0e on line 5 Warning: get_headers(http://t0.gstatic.com/images?q=tbn:ANd9GcRJKXYLKY7mIU6i2xLRG7Az9Ze2QbpwiJ50IHaOWbB6K8wLSClwf0WAp5FQ1g): failed to open stream: Bad file descriptor in /in/RXp0e on line 5 Fatal error: Call to undefined function curl_init() in /in/RXp0e on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<pre> Fatal error: Call to undefined function: get_headers() in /in/RXp0e on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<pre> Fatal error: Call to undefined function: get_headers() in /in/RXp0e on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<pre> Fatal error: Call to undefined function: get_headers() in /in/RXp0e on line 5