PhpSandbox\PHPSandbox::undefineSuperglobals PHP 메소드

undefineSuperglobals() 공개 메소드

You can pass an array of superglobal names to undefine, or an associative array of superglobals names and key to undefine, or an empty array or null to undefine all superglobals
public undefineSuperglobals ( array $superglobals = [] )
$superglobals array Associative array of superglobal names and keys or array of superglobal names to undefine
    public function undefineSuperglobals(array $superglobals = [])
    {
        if (count($superglobals)) {
            foreach ($superglobals as $superglobal => $name) {
                $name = $this->normalizeSuperglobal($name);
                $this->undefineSuperglobal(is_int($superglobal) ? $name : $superglobal, is_int($superglobal) || !is_string($name) ? null : $name);
            }
        } else {
            $this->definitions['superglobals'] = [];
        }
        return $this;
    }
PHPSandbox