* @var array<string,string> - Maps from a built in superglobal name to a UnionType spec string.
* The string array keys **can** be integers in edge cases, but those should be rare.
* (e.g. ${4} = 'x'; adds 4 to $GLOBALS.
* And user-provided input of integer representations of strings as keys would also become integers.
*/
publicconst_BUILTIN_SUPERGLOBAL_TYPES=[
'_GET'=>'array<string,string|string[]>',
'_POST'=>'array<string,string|string[]>',
'_COOKIE'=>'array<string,string|string[]>',
'_REQUEST'=>'array<string,string|string[]>',
'_SERVER'=>'array<string,mixed>',
'_ENV'=>'array<string,string>',
'_FILES'=>'array<string,array<string,int|string|array<string,int|string>>>',// Can have multiple files with the same name.
'_SESSION'=>'array<string,mixed>',
'GLOBALS'=>'array<string,mixed>',
'http_response_header'=>'list<string>|null',// Revisit when we implement sub-block type refining
];
/**
* @var array<string,string>
* @internal this will be protected in a future release
*
* NOTE: The string array keys of superglobals **can** be integers in edge cases, but those should be rare.
* (e.g. ${4} = 'x'; adds 4 to $GLOBALS.
* And user-provided input of integer representations of strings as keys would also become integers.
*/
publicconst_BUILTIN_GLOBAL_TYPES=[
'_GET'=>'array<string,string|string[]>',
'_POST'=>'array<string,string|string[]>',
'_COOKIE'=>'array<string,string|string[]>',
'_REQUEST'=>'array<string,string|string[]>',
'_SERVER'=>'array<string,mixed>',
'_ENV'=>'array<string,string>',
'_FILES'=>'array<string,array<string,int>>|array<string,array<string,string>>|array<string,array<string,list<int>>>|array<string,array<string,list<string>>>',// Can have multiple files with the same name.
'_SESSION'=>'array<string,mixed>',
'GLOBALS'=>'array<string,mixed>',
'http_response_header'=>'list<string>|null',// Revisit when we implement sub-block type refining
'argv'=>'list<string>',
'argc'=>'int',
];
/**
public function __construct(
Context $context,
string $name,
UnionType $type,
int $flags
) {
parent::__construct(
$context,
$name,
$type,
$flags
);
}
*/
/**
* @return bool
* This will always return false in so far as variables
* cannot be passed by reference.
* @suppress PhanUnreferencedPublicMethod this is added for convenience for plugins
*/
publicfunctionisPassByReference():bool
{
returnfalse;
}
/**
* @return bool
* This will always return false in so far as variables
* cannot be variadic
* @suppress PhanUnreferencedPublicMethod this may be useful in the future.