3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 5.6.28, 7.0.14 - 7.1.0
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 5.3.0 - 5.6.25, 7.0.0 - 7.0.10
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 hhvm-3.12.0
Your IP Address Is : <b><u></u></b> </br> [ Notice: Undefined variable: REMOTE_ADDR in /in/dbQDn on line 7 Warning: gethostbyname() expects parameter 1 to be string, null given in /in/dbQDn on line 7 Linux php_shell 4.6.4-1-ARCH #1 SMP PREEMPT Mon Jul 11 19:12:32 CEST 2016 x86_64 ] </br> [ Notice: Undefined index: HTTP_USER_AGENT in /in/dbQDn on line 37
Output for hhvm-3.10.0
Your IP Address Is : <b><u></u></b> </br> [ Notice: Undefined variable: REMOTE_ADDR in /in/dbQDn on line 7 Linux php_shell 4.6.4-1-ARCH #1 SMP PREEMPT Mon Jul 11 19:12:32 CEST 2016 x86_64 ] </br> [ Notice: Undefined index: HTTP_USER_AGENT in /in/dbQDn on line 37
Output for 5.0.4 - 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 - 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