Workerman\Protocols\Http::end PHP Method

end() public static method

End, like call exit in php-fpm.
public static end ( string $msg = '' )
$msg string
    public static function end($msg = '')
    {
        if (PHP_SAPI != 'cli') {
            exit($msg);
        }
        if ($msg) {
            echo $msg;
        }
        throw new \Exception('jump_exit');
    }

Usage Example

/**
 * 退出
 * @param string $str
 */
function _exit($str = '')
{
    if (defined('WORKERMAN_ROOT_DIR')) {
        return Http::end($str);
    }
    return exit($str);
}
All Usage Examples Of Workerman\Protocols\Http::end