3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); ini_set('display_errors', true); ini_set('display_startup_errors', true); $district = array( // 'distrikt' => array( // 'yoda' // ), 'paderborn-stadtundland' => array( 'paderborn-stadtundland', 'paderborn-stadt-land', 'pbsl' ) ,'detmold-blomberg' => array( 'rotary-detmold-blomberg', 'rcdetmold-blomberg', 'detmold' ) ,'witten-hohenstein' => array( 'witten-hohenstein' ) ,'de-balt' => array( 'rotary-balticstates-germany', 'debalt' ) ,'essen-centennial' => array( 'rotary-essen' ) ,'schwerte' => array( 'rotaryclubschwerte' ) ,'luedenscheid-mark' => array( 'luedenscheidmark' ) ,'pirna' => array( 'pirna-saechsische-schweiz' ) ,'paderborn-buerener-land' => array( 'paderborn-buerenerland', 'buerener-land', 'rcpbbl' ) ,'essen-baldeney' => array( 'essen-ost' ) ,'paderborn-kaiserpfalz' => array( 'rcpbk', 'rotpbk' ) ,'loeningen-hasetal-haseluenne' => array( 'hasetal') ,'osterholz-scharmbeck' => array( 'osterholzscharmbeck') ,'haren-ems' => array( 'haren') ,'bad-bederkesa' => array( 'bederkesa') ,'hohenkarpfen-tuttlingen' => array( 'hohenkarpfen') ,'kelsterbach-rhein-main-international' => array( 'rmi') ); // rc- entfernen function removePrefixes($string){ $string = preg_replace('/^rc(-)?/', '', $string); $string = preg_replace('/^rotary(-)?(club\.?-?)?/', '', $string); return $string; } // echo $subdomain; function domainistgleich($subdomain, $district){ foreach ($district as $key => $value) { if (in_array($subdomain, removePrefixes($value))){ return $key; } } return $subdomain; } // print_r($_SERVER); // subdomain finden if ($_GET['subdomain']) { $subdomain = $_GET['subdomain']; $subdomain = removePrefixes($subdomain); $subdomain = array_shift(explode(".",$subdomain)); } else{ $subdomain = $_SERVER['HTTP_HOST']; $subdomain = removePrefixes($subdomain); $subdomain = array_shift(explode(".",$subdomain)); } $domain = domainistgleich($subdomain, $district); print_r($_SERVER); die 'aaa'.$domain; if ($domain !== false){ if ($_GET['subdomain']) die($_SERVER['HTTP_HOST'].'/'.$domain); // dauerhafte PHP-Weiterleitung (Statuscode 301) header("HTTP/1.1 301 Moved Permanently"); // Weiterleitungsziel. Wohin soll eine permanente Weiterleitung erfolgen? header("Location:".$_SERVER['HTTP_HOST'].$domain); exit; } ?>
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected ''aaa'' (T_CONSTANT_ENCAPSED_STRING) in /in/jXHdS on line 98
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /in/jXHdS on line 98
Process exited with code 255.