PhpSandbox\PHPSandbox::_get_magic_const PHP Méthode

_get_magic_const() public méthode

Get PHPSandbox redefined magic constant. This is an internal PHPSandbox function but requires public access to work.
public _get_magic_const ( string $name ) : array
$name string Requested magic constant name (e.g. __FILE__, __LINE__, etc.)
Résultat array Returns the redefined magic constant
    public function _get_magic_const($name)
    {
        $name = $this->normalizeMagicConst($name);
        if (isset($this->definitions['magic_constants'][$name])) {
            $magic_constant = $this->definitions['magic_constants'][$name];
            if (is_callable($magic_constant)) {
                return call_user_func_array($magic_constant, [$this]);
            }
            return $magic_constant;
        }
        return null;
    }
PHPSandbox