src/Util/U.php
public static function http_response_code($newcode = NULL)
    {
        static $code = 200;
        if($newcode !== NULL)
        {
            header('X-PHP-Response-Code: '.$newcode, true, $newcode);
            if(!headers_sent())
                $code = $newcode;
        }
        return $code;
    }
public static function http_response_code($newcode = NULL)
    {
        static $code = 200;
        if($newcode !== NULL)
        {
            header('X-PHP-Response-Code: '.$newcode, true, $newcode);
            if(!headers_sent())
                $code = $newcode;
        }
        return $code;
    }
public static function http_response_code ( $ newcode = NULL ) { static $ code = 200 ; if ( $ newcode !== NULL ) { header ( 'X-PHP-Response-Code: ' . $ newcode , true , $ newcode ) ; if ( ! headers_sent ( ) ) $ code = $ newcode ; } return $ code ; }
For 4.3.0 <= PHP <= 5.4.0
For 4 . 3 . 0 < = PHP < = 5 . 4 . 0