/** * If set to true, this will prevent redirects and cause redirect() to throw an Exception. * * @param bool $value Enable or disable. * @return bool Returns the old value. */ public static function setPreventRedirect($value) { $oldValue = self::$preventRedirect; self::$preventRedirect = (bool) $value; return $oldValue; }