3v4l.org

run code in 200+ PHP versions simultaneously
<?php $server = $_SERVER['REMOTE_ADDR']; $rrs = file_get_contents("http://api.sypexgeo.net/json/".$server); $obj = json_decode($rrs); $country = $obj->country->name_ru; var_dump($obj);
Output for 7.2.0 - 7.4.2
Notice: Undefined index: REMOTE_ADDR in /in/vR1u0 on line 3 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/vR1u0 on line 4 Warning: file_get_contents(http://api.sypexgeo.net/json/): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/vR1u0 on line 4 Notice: Trying to get property 'country' of non-object in /in/vR1u0 on line 6 Notice: Trying to get property 'name_ru' of non-object in /in/vR1u0 on line 6 NULL