3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<pre> Warning: get_headers(): php_network_getaddresses: getaddrinfo for t0.gstatic.com failed: System error 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 for t0.gstatic.com failed: System error 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 8.0.13 - 8.0.30
<pre> Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: System error 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: System error 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 8.0.0 - 8.0.12
<pre> Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution 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: Temporary failure in name resolution 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 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.13, 7.3.32 - 7.3.33, 7.4.0 - 7.4.1, 7.4.26 - 7.4.33
<pre> Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: System error 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: System error 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 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.25
<pre> Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution 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: Temporary failure in name resolution 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 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
<pre> Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: System error 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: System error 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.2.6 - 5.2.17
<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.0.5, 5.1.0 - 5.1.6, 5.2.0 - 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.3.11, 4.4.0 - 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

preferences:
336.74 ms | 401 KiB | 460 Q