3v4l.org

run code in 200+ PHP versions simultaneously
<?php function clientIp() { $ipaddress = getenv('HTTP_CLIENT_IP')?: getenv('HTTP_X_FORWARDED_FOR')?: getenv('HTTP_X_FORWARDED')?: getenv('HTTP_FORWARDED_FOR')?: getenv('HTTP_FORWARDED')?: getenv('REMOTE_ADDR'); return $ipaddress; } clientIp();
Output for 7.2.0 - 7.4.6