3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (strpos($_SERVER['HTTP_HOST'],"test.mijndomein.nl") > 0) { $redirect = "test.php"; } elseif (strpos($_SERVER['HTTP_HOST'],"www.mijndomein.nl") > 0) { $redirect = "index.php"; } elseif (strpos($_SERVER['HTTP_HOST'],"beheer.mijndomein.nl") > 0) { $redirect = "beheer.php"; } else { $redirect = "index.php"; } header("Location: ".$redirect ); exit(); ?>
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.2.6
Notice: Undefined index: HTTP_HOST in /in/5Io9l on line 2 Notice: Undefined index: HTTP_HOST in /in/5Io9l on line 4 Notice: Undefined index: HTTP_HOST in /in/5Io9l on line 6 Warning: Cannot modify header information - headers already sent by (output started at /in/5Io9l:2) in /in/5Io9l on line 12
Output for hhvm-3.15.4
Notice: Undefined index: HTTP_HOST in /in/5Io9l on line 2 Warning: strpos() expects parameter 1 to be string, null given in /in/5Io9l on line 2 Notice: Undefined index: HTTP_HOST in /in/5Io9l on line 4 Warning: strpos() expects parameter 1 to be string, null given in /in/5Io9l on line 4 Notice: Undefined index: HTTP_HOST in /in/5Io9l on line 6 Warning: strpos() expects parameter 1 to be string, null given in /in/5Io9l on line 6