Menu

Reference / Manticore\Sapi

responseBegin()

function
function responseBegin(): void

Start a RESPONSE on the current flow, without touching the superglobals.

The cheap half of {@see requestBegin}: an empty header block, status 200, and the flow marked live — which is all header(), setcookie() and http_response_code() need to work. Http\Server calls this for every request so those functions are live in every handler, and only calls the full begin() when a program asked for $_GET/$_POST (compat(true)): seeding four superglobals per request for code that never reads them is pure cost.

View source