3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ip = getenv("REMOTE_ADDR") ; echo "Your IP Address Is : <b><u>$ip</u></b> "; ?></br> [ <?php GetHostByName($REMOTE_ADDR); echo php_uname(); ?> ] </br> [ <?php function getip() { if (isSet($_SERVER)) { if (isSet($_SERVER["HTTP_X_FORWARDED_FOR"])) { $realip = $_SERVER["HTTP_X_FORWARDED_FOR"]; } elseif (isSet($_SERVER["HTTP_CLIENT_IP"])) { $realip = $_SERVER["HTTP_CLIENT_IP"]; } else { $realip = $_SERVER["REMOTE_ADDR"]; } } else { if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) { $realip = getenv( 'HTTP_X_FORWARDED_FOR' ); } elseif ( getenv( 'HTTP_CLIENT_IP' ) ) { $realip = getenv( 'HTTP_CLIENT_IP' ); } else { $realip = getenv( 'REMOTE_ADDR' ); } } return $realip; } //print out the ip and browser information echo $_SERVER["HTTP_USER_AGENT"] ?>
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Your IP Address Is : <b><u></u></b> </br> [ Warning: Undefined variable $REMOTE_ADDR in /in/dbQDn on line 7 Deprecated: gethostbyname(): Passing null to parameter #1 ($hostname) of type string is deprecated in /in/dbQDn on line 7 Linux php_shell 4.8.6-1-ARCH #1 SMP PREEMPT Mon Oct 31 18:51:30 CET 2016 x86_64 ] </br> [ Warning: Undefined array key "HTTP_USER_AGENT" in /in/dbQDn on line 37
Output for 8.0.0 - 8.0.30
Your IP Address Is : <b><u></u></b> </br> [ Warning: Undefined variable $REMOTE_ADDR in /in/dbQDn on line 7 Linux php_shell 4.8.6-1-ARCH #1 SMP PREEMPT Mon Oct 31 18:51:30 CET 2016 x86_64 ] </br> [ Warning: Undefined array key "HTTP_USER_AGENT" in /in/dbQDn on line 37
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Your IP Address Is : <b><u></u></b> </br> [ Notice: Undefined variable: REMOTE_ADDR in /in/dbQDn on line 7 Linux php_shell 4.8.6-1-ARCH #1 SMP PREEMPT Mon Oct 31 18:51:30 CET 2016 x86_64 ] </br> [ Notice: Undefined index: HTTP_USER_AGENT in /in/dbQDn on line 37
Output for 7.3.32 - 7.3.33
Your IP Address Is : <b><u></u></b> </br> [ Linux php_shell 4.8.6-1-ARCH #1 SMP PREEMPT Mon Oct 31 18:51:30 CET 2016 x86_64 ] </br> [
Output for 5.0.4 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Your IP Address Is : <b><u></u></b> </br> [ Notice: Undefined variable: REMOTE_ADDR in /in/dbQDn on line 7 Linux php_shell 4.7.0-1-ARCH #1 SMP PREEMPT Mon Aug 8 22:05:58 CEST 2016 x86_64 ] </br> [ Notice: Undefined index: HTTP_USER_AGENT in /in/dbQDn on line 37
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.3
Your IP Address Is : <b><u></u></b> </br> [ Notice: Undefined variable: REMOTE_ADDR in /in/dbQDn on line 7 Linux php_shell 4.7.0-1-ARCH #1 SMP PREEMPT Mon Aug 8 22:05:58 CEST 2016 x86_64 ] </br> [ Notice: Undefined index: HTTP_USER_AGENT in /in/dbQDn on line 37

preferences:
356.97 ms | 402 KiB | 460 Q