3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $user_ip = getenv('REMOTE_ADDR'); $geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip")); $city = $geo["geoplugin_city"]; $region = $geo["geoplugin_regionName"]; $country = $geo["geoplugin_countryName"]; echo "City: ".$city."<br>"; echo "Region: ".$region."<br>"; echo "Country: ".$country."<br>"; /* geoplugin_request geoplugin_status geoplugin_credit geoplugin_city geoplugin_region geoplugin_areaCode geoplugin_dmaCode geoplugin_countryCode geoplugin_countryName geoplugin_continentCode geoplugin_latitude geoplugin_longitude geoplugin_regionCode geoplugin_regionName geoplugin_currencyCode geoplugin_currencySymbol geoplugin_currencySymbol_UTF8 geoplugin_currencyConverter */ ?>
based on lVhdo
Output for 7.0.20, 7.1.5 - 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/H7cVk on line 3 Warning: file_get_contents(http://www.geoplugin.net/php.gp?ip=): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/H7cVk on line 3 City: <br>Region: <br>Country: <br>
Output for 5.4.0 - 7.0.7, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/H7cVk on line 3 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/H7cVk on line 3 City: <br>Region: <br>Country: <br>