Menu
requestBegin()
function
function requestBegin(
array<string,string> $server = [],
array<int|string,mixed> $get = [],
array<int|string,mixed> $post = [],
array<string,string> $cookie = [],
array<int|string,mixed> $files = []
): void
Begin serving a request on the current flow: seed the request superglobals and start an empty response.
A server written on Async calls this with the parsed request, runs the
handler, then calls {@see requestEnd}. $server is merged over the process
$_SERVER, so CLI keys such as SCRIPT_NAME and argv stay visible.
$_REQUEST is built GET-then-POST, php's default request order, and
$_SESSION starts empty. While the request is live, header(),
setcookie() and http_response_code() record into this flow's response.
Parameters
$serverarray<string,string> = []- entries merged over
$_SERVER(REQUEST_URI, REQUEST_METHOD, HTTP_* ...) $getarray<int|string,mixed> = []- becomes
$_GET; nested values fora[]=1style input $postarray<int|string,mixed> = []- becomes
$_POST $cookiearray<string,string> = []- becomes
$_COOKIE $filesarray<int|string,mixed> = []- becomes
$_FILES