3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $headers = ''; foreach ($_SERVER as $key => $value) { if (strpos($key, 'HTTP_') === 0 && $key != 'HTTP_HOST' && $key != 'HTTP_CONNECTION') { $key = strtolower(strtr(substr($key, 5), '_', '-')); $headers .= $key . ': ' . $value . "\r\n"; } } $opts = array( 'http'=>array( 'method'=>"GET", 'header'=> $headers, ) ); echo file_get_contents('http://phd.yandex.net/detect', false, stream_context_create($opts));
Output for 7.0.20, 7.1.5 - 7.3.1
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/islVq on line 18 Warning: file_get_contents(http://phd.yandex.net/detect): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/islVq on line 18
Output for 5.2.6 - 7.0.14, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/islVq on line 18 Warning: file_get_contents(http://phd.yandex.net/detect): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/islVq on line 18
Output for 5.0.3 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/islVq on line 18 Warning: file_get_contents(http://phd.yandex.net/detect): failed to open stream: Connection refused in /in/islVq on line 18
Output for 5.0.1 - 5.0.2
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/islVq on line 18 Warning: file_get_contents(http://phd.yandex.net/detect): failed to open stream: Success in /in/islVq on line 18
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/islVq on line 18 Warning: file_get_contents(http://phd.yandex.net/detect): failed to open stream: Bad file descriptor in /in/islVq on line 18
Output for 4.3.0 - 4.4.9
Warning: file_get_contents() expects at most 2 parameters, 3 given in /in/islVq on line 18