3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "<div>ip: " . $_SERVER['REMOTE_ADDR'] . "</div>"; echo "<div>http-x-ip: " . $_SERVER['HTTP_X_FORWARDED_FOR'] . "</div>"; foreach (getallheaders() as $name => $value) { echo "<div>$name: $value</div>"; } ?>
Output for 7.0.0 - 7.2.0
Notice: Undefined index: REMOTE_ADDR in /in/u26QU on line 3 <div>ip: </div> Notice: Undefined index: HTTP_X_FORWARDED_FOR in /in/u26QU on line 4 <div>http-x-ip: </div> Fatal error: Uncaught Error: Call to undefined function getallheaders() in /in/u26QU:5 Stack trace: #0 {main} thrown in /in/u26QU on line 5
Process exited with code 255.
Output for 5.3.7 - 5.6.28
Notice: Undefined index: REMOTE_ADDR in /in/u26QU on line 3 <div>ip: </div> Notice: Undefined index: HTTP_X_FORWARDED_FOR in /in/u26QU on line 4 <div>http-x-ip: </div> Fatal error: Call to undefined function getallheaders() in /in/u26QU on line 5
Process exited with code 255.