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://www.redcoon.es/res/shop/cataloge/product_200/B351504.jpg'); var_dump($b);
Output for git.master, git.master_jit
Warning: get_headers(): php_network_getaddresses: getaddrinfo for www.redcoon.es failed: System error in /in/Q1aDE on line 4 Warning: get_headers(http://www.redcoon.es/res/shop/cataloge/product_200/B351504.jpg): Failed to open stream: php_network_getaddresses: getaddrinfo for www.redcoon.es failed: System error in /in/Q1aDE on line 4 Warning: Trying to access array offset on value of type bool in /in/Q1aDE on line 6 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/Q1aDE on line 6 string(0) "" string(0) ""
Output for rfc.property-hooks
Warning: get_headers(): php_network_getaddresses: getaddrinfo for www.redcoon.es failed: System error in /in/Q1aDE on line 4 Warning: get_headers(http://www.redcoon.es/res/shop/cataloge/product_200/B351504.jpg): Failed to open stream: php_network_getaddresses: getaddrinfo for www.redcoon.es failed: System error in /in/Q1aDE on line 4 Warning: Trying to access array offset on false in /in/Q1aDE on line 6 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/Q1aDE 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:
58.01 ms | 402 KiB | 8 Q