3v4l.org

run code in 300+ PHP versions simultaneously
<?php $headers = get_headers('http://www.example.com/file.jpg'); if($headers[0]=='HTTP/1.0 200 OK'){ echo 'true'; // file exists }else{ echo 'false'; // file doesn't exists }
Output for git.master, git.master_jit
Warning: get_headers(): php_network_getaddresses: getaddrinfo for www.example.com failed: System error in /in/9ItS9 on line 3 Warning: get_headers(http://www.example.com/file.jpg): Failed to open stream: php_network_getaddresses: getaddrinfo for www.example.com failed: System error in /in/9ItS9 on line 3 Warning: Trying to access array offset on value of type bool in /in/9ItS9 on line 5 false
Output for rfc.property-hooks
Warning: get_headers(): php_network_getaddresses: getaddrinfo for www.example.com failed: System error in /in/9ItS9 on line 3 Warning: get_headers(http://www.example.com/file.jpg): Failed to open stream: php_network_getaddresses: getaddrinfo for www.example.com failed: System error in /in/9ItS9 on line 3 Warning: Trying to access array offset on false in /in/9ItS9 on line 5 false

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:
41.5 ms | 402 KiB | 8 Q