3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRealIpAddr() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet { $ip .= 'HTTP_CLIENT_IP'.$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy { $ip .= 'HTTP_X_FORWARDED_FOR'.$_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip .= 'REMOTE_ADDR'.$_SERVER['REMOTE_ADDR']; } return $ip; } getRealIpAddr(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "REMOTE_ADDR" in /in/2Njpm on line 14 Warning: Undefined variable $ip in /in/2Njpm on line 14

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
36.38 ms | 401 KiB | 8 Q