public function getChar($position = self::CURRENT_POSITION)
    {
        if (self::CURRENT_POSITION === $position) {
            $position = $this->position;
        }

        if (!is_int($position)) {
            throw new Exception('Position is not int. ' . gettype($position));
        }

        if ($this->eof()) {
            throw new Exception('Index out of range. Position: ' . $position . '.');
        }

        return $this->data[$position];
    }
public function getChar($position = self::CURRENT_POSITION)
    {
        if (self::CURRENT_POSITION === $position) {
            $position = $this->position;
        }

        if (!is_int($position)) {
            throw new Exception('Position is not int. ' . gettype($position));
        }

        if ($this->eof()) {
            throw new Exception('Index out of range. Position: ' . $position . '.');
        }

        return $this->data[$position];
    }
public function getChar ( $ position = self :: CURRENT_POSITION ) { if ( self :: CURRENT_POSITION === $ position ) { $ position = $ this -> position ; } if ( ! is_int ( $ position ) ) { throw new Exception ( 'Position is not int. ' . gettype ( $ position ) ) ; } if ( $ this -> eof ( ) ) { throw new Exception ( 'Index out of range. Position: ' . $ position . '.' ) ; } return $ this -> data [ $ position ] ; }
Returns one character of the string.

Does not move the string pointer. Use inc() to move the pointer after getChar().

@param int $position If not specified, current character is returned.
@return string The current character (under the pointer).
@throws Exception When out of range
Returns one character of the string .