PhpSandbox\PHPSandbox::isDefinedSuperglobal PHP Method

isDefinedSuperglobal() public method

Check if PHPSandbox instance has $name superglobal defined, or if superglobal $name key is defined
public isDefinedSuperglobal ( string $name, string | null $key = null ) : boolean
$name string String of superglobal $name to query
$key string | null String of key to to query in superglobal
return boolean Returns true if PHPSandbox instance has defined superglobal, false otherwise
    public function isDefinedSuperglobal($name, $key = null)
    {
        $name = $this->normalizeSuperglobal($name);
        return $key !== null ? isset($this->definitions['superglobals'][$name][$key]) : isset($this->definitions['superglobals'][$name]);
    }
PHPSandbox