public function get($path)
    {
        if ($path instanceof Context) {
            $path = $path->unwrap();
        }
        if ($path === null) {
            return null;
        } elseif (is_string($path) || is_integer($path)) {
            if (is_array($this->value)) {
                return array_key_exists($path, $this->value) ? $this->value[$path] : null;
            } elseif (is_object($this->value)) {
                try {
                    return ObjectAccess::getProperty($this->value, $path);
                } catch (PropertyNotAccessibleException $exception) {
                    return null;
                }
            }
        } else {
            throw new EvaluationException('Path is not of type string or integer, got ' . gettype($path), 1344418464);
        }
    }
public function get($path)
    {
        if ($path instanceof Context) {
            $path = $path->unwrap();
        }
        if ($path === null) {
            return null;
        } elseif (is_string($path) || is_integer($path)) {
            if (is_array($this->value)) {
                return array_key_exists($path, $this->value) ? $this->value[$path] : null;
            } elseif (is_object($this->value)) {
                try {
                    return ObjectAccess::getProperty($this->value, $path);
                } catch (PropertyNotAccessibleException $exception) {
                    return null;
                }
            }
        } else {
            throw new EvaluationException('Path is not of type string or integer, got ' . gettype($path), 1344418464);
        }
    }
public function get ( $ path ) { if ( $ path instanceof Context ) { $ path = $ path -> unwrap ( ) ; } if ( $ path === null ) { return null ; } elseif ( is_string ( $ path ) || is_integer ( $ path ) ) { if ( is_array ( $ this -> value ) ) { return array_key_exists ( $ path , $ this -> value ) ? $ this -> value [ $ path ] : null ; } elseif ( is_object ( $ this -> value ) ) { try { return ObjectAccess :: getProperty ( $ this -> value , $ path ) ; } catch ( PropertyNotAccessibleException $ exception ) { return null ; } } } else { throw new EvaluationException ( 'Path is not of type string or integer, got ' . gettype ( $ path ) , 1344418464 ) ; } }
Get a value of the context

This basically acts as a safe access to non-existing properties, unified array and
property access (using getters) and access to the current value (empty path).

If a property or key did not exist this method will return NULL.

@param string|integer|Context $path The path as string or Context value, will be unwrapped for convenience
@return mixed The value
@throws EvaluationException
Get a value of the context