src/ArrayObject.php
public function first()
    {
        if (!$this->isCollection()) {
            return $this;
        }

        return isset($this->data[0]) ? $this->box($this->data[0]) : null;
    }
public function first()
    {
        if (!$this->isCollection()) {
            return $this;
        }

        return isset($this->data[0]) ? $this->box($this->data[0]) : null;
    }
public function first ( ) { if ( ! $ this -> isCollection ( ) ) { return $ this ; } return isset ( $ this -> data [ 0 ] ) ? $ this -> box ( $ this -> data [ 0 ] ) : null ; }
Returns the first element in the collection.

@return mixed
Returns the first element in the collection .