Flow\JSONPath\JSONPath::last PHP Method

last() public method

Evaluate an expression and return the last result
public last ( ) : mixed
return mixed
    public function last()
    {
        $keys = AccessHelper::collectionKeys($this->data);
        if (empty($keys)) {
            return null;
        }
        $value = $this->data[end($keys)] ? $this->data[end($keys)] : null;
        return AccessHelper::isCollectionType($value) ? new static($value, $this->options) : $value;
    }