public function getChild(string $path): self
    {
        $path = trim($path, '/');
        $expression = '"'.str_replace('/', '"."', $path).'"';

        $childValue = search($expression, $this->value);

        return new self($this->reference->getChild($path), $childValue);
    }
public function getChild(string $path): self
    {
        $path = trim($path, '/');
        $expression = '"'.str_replace('/', '"."', $path).'"';

        $childValue = search($expression, $this->value);

        return new self($this->reference->getChild($path), $childValue);
    }
public function getChild ( string $ path ) : self { $ path = trim ( $ path , '/' ) ; $ expression = '"' . str_replace ( '/' , '"."' , $ path ) . '"' ; $ childValue = search ( $ expression , $ this -> value ) ; return new self ( $ this -> reference -> getChild ( $ path ) , $ childValue ) ; }
Returns another Snapshot for the location at the specified relative path.

Passing a relative path to the child() method of a Snapshot returns another Snapshot for the location
at the specified relative path. The relative path can either be a simple child name (e.g. "ada") or a
deeper, slash-separated path (e.g. "ada/name/first"). If the child location has no data, an empty
Snapshot (that is, a Snapshot whose value is null) is returned.

@see https://firebase.google.com/docs/reference/js/firebase.database.DataSnapshot#child

@param string $path

@throws InvalidArgumentException if the given child path is invalid

@return Snapshot
Returns another Snapshot for the location at the specified relative path .