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.

Rechercher une fonction PHP

ReflectionType::allowsNull

(PHP 7)

ReflectionType::allowsNullChecks if null is allowed

Description

public ReflectionType::allowsNull ( void ) : bool

Checks whether the parameter allows NULL.

PHP: ReflectionType::allowsNull - Manual Home of Manuel PHP  Contents Haut

Parameters

This function has no parameters.

PHP: ReflectionType::allowsNull - Manual Home of Manuel PHP  Contents Haut

Return Values

TRUE if NULL is allowed, otherwise FALSE

PHP: ReflectionType::allowsNull - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 ReflectionType::allowsNull() example

<?php
function someFunction(string $paramStdClass $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)

Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph