3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? $ip = $_SERVER['REMOTE_ADDR']; $geopluginURL='http://www.geoplugin.net/php.gp?ip='.$ip; $addrDetailsArr = unserialize(file_get_contents($geopluginURL)); $country = $addrDetailsArr['geoplugin_countryName']; echo $country; ?>
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined index: REMOTE_ADDR in /in/Jf9ek on line 2 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/Jf9ek on line 4 Warning: file_get_contents(http://www.geoplugin.net/php.gp?ip=): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/Jf9ek on line 4
Output for hhvm-3.12.0
Notice: Undefined index: REMOTE_ADDR in /in/Jf9ek on line 2 Warning: Failed to open http://www.geoplugin.net/php.gp?ip= (Could not resolve host: www.geoplugin.net) in /in/Jf9ek on line 4
Output for hhvm-3.10.0
Notice: Undefined index: REMOTE_ADDR in /in/Jf9ek on line -1 Warning: Failed to open http://www.geoplugin.net/php.gp?ip= (Could not resolve host: www.geoplugin.net) in /in/Jf9ek on line -1
Output for 4.3.0 - 5.3.29
<? $ip = $_SERVER['REMOTE_ADDR']; $geopluginURL='http://www.geoplugin.net/php.gp?ip='.$ip; $addrDetailsArr = unserialize(file_get_contents($geopluginURL)); $country = $addrDetailsArr['geoplugin_countryName']; echo $country; ?>