3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRemoteAddr() { if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR']) { if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) { $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); return $ips[0]; } else return $_SERVER['HTTP_X_FORWARDED_FOR']; } return $_SERVER['REMOTE_ADDR']; } list($rn1, $rn2) = explode(".",getRemoteAddr()); var_dump($rn1); echo "\n"; var_dump($rn2);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "REMOTE_ADDR" in /in/T4bRq on line 14 Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/T4bRq on line 16 Warning: Undefined array key 1 in /in/T4bRq on line 16 string(0) "" NULL

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:
39.65 ms | 402 KiB | 8 Q