PhpSandbox\PHPSandbox::hasDefinedSuperglobals PHP Méthode

hasDefinedSuperglobals() public méthode

Query whether PHPSandbox instance has defined superglobals, or if superglobal $name has defined keys
public hasDefinedSuperglobals ( string | null $name = null ) : integer | boolean
$name string | null String of superglobal $name to check for keys
Résultat integer | boolean Returns the number of superglobals or superglobal keys this instance has defined, or false if invalid superglobal name specified
    public function hasDefinedSuperglobals($name = null)
    {
        $name = $name ? $this->normalizeSuperglobal($name) : null;
        return $name ? isset($this->definitions['superglobals'][$name]) ? count($this->definitions['superglobals'][$name]) : false : count($this->definitions['superglobals']);
    }
PHPSandbox