3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_http_response_code($url) { $headers = get_headers($url); // echo substr($headers[0], 9, 3); $headers = substr($headers[0], 9, 3); // $headers = "bla"; // setting headers to bla works then $b = bla; var_dump($headers); //returns string 3 (404) return $headers; } $b = get_http_response_code('http://noneexisting.com/blabla.html'); var_dump($b);
Output for git.master, git.master_jit
Warning: get_headers(): php_network_getaddresses: getaddrinfo for noneexisting.com failed: System error in /in/aup20 on line 4 Warning: get_headers(http://noneexisting.com/blabla.html): Failed to open stream: php_network_getaddresses: getaddrinfo for noneexisting.com failed: System error in /in/aup20 on line 4 Warning: Trying to access array offset on value of type bool in /in/aup20 on line 6 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/aup20 on line 6 string(0) "" string(0) ""
Output for rfc.property-hooks
Warning: get_headers(): php_network_getaddresses: getaddrinfo for noneexisting.com failed: System error in /in/aup20 on line 4 Warning: get_headers(http://noneexisting.com/blabla.html): Failed to open stream: php_network_getaddresses: getaddrinfo for noneexisting.com failed: System error in /in/aup20 on line 4 Warning: Trying to access array offset on false in /in/aup20 on line 6 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/aup20 on line 6 string(0) "" string(0) ""

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