No cache version.
Caching disabled. Default setting for this page:enabled (code LNG204)If the display is too slow, you can disable the user mode to view the cached version.
ReflectionType::allowsNull
(PHP 7)
ReflectionType::allowsNull — Checks if null is allowed
Description
public ReflectionType::allowsNull
( void
) : bool
Checks whether the parameter allows NULL
.
Examples
Example #1 ReflectionType::allowsNull() example
<?php
function someFunction(string $param, StdClass $param2 = null) {}
$reflectionFunc = new ReflectionFunction('someFunction');
$reflectionParams = $reflectionFunc->getParameters();
var_dump($reflectionParams[0]->getType()->allowsNull());
var_dump($reflectionParams[1]->getType()->allowsNull());
The above example will output something similar to:
bool(false) bool(true)
See Also
- ReflectionType::isBuiltin() - Checks if it is a built-in type
- ReflectionType::__toString() - To string
- ReflectionParameter::getType() - Gets a parameter's type
Can not display this page of the Infobrol website
Type of error (18-01)
Unknown format specifier "&"Please try again in a few minutes…
Steph