src/ArrayObject.php
public function each(callable $callback)
    {
        if ($this->isCollection()) {
            foreach ($this->data as $val) {
                $callback($this->box($val));
            }
        } else {
            $callback($this->box($this->data));
        }

        return $this;
    }
public function each(callable $callback)
    {
        if ($this->isCollection()) {
            foreach ($this->data as $val) {
                $callback($this->box($val));
            }
        } else {
            $callback($this->box($this->data));
        }

        return $this;
    }
public function each ( callable $ callback ) { if ( $ this -> isCollection ( ) ) { foreach ( $ this -> data as $ val ) { $ callback ( $ this -> box ( $ val ) ) ; } } else { $ callback ( $ this -> box ( $ this -> data ) ) ; } return $ this ; }
Fire callback for each member of the array.

@param callable $callback

@return $this
Fire callback for each member of the array .