public function charsWhile($bytes, $max = null) {
        if ($this->char < $this->EOF) {
            if ($max === 0 || $max) {
                $len = strspn($this->data, $bytes, $this->char, $max);
            } else {
                $len = strspn($this->data, $bytes, $this->char);
            }
            $string = (string) substr($this->data, $this->char, $len);
            $this->char += $len;
            return $string;
        } else {
            return false;
        }
    }
public function charsWhile($bytes, $max = null) {
        if ($this->char < $this->EOF) {
            if ($max === 0 || $max) {
                $len = strspn($this->data, $bytes, $this->char, $max);
            } else {
                $len = strspn($this->data, $bytes, $this->char);
            }
            $string = (string) substr($this->data, $this->char, $len);
            $this->char += $len;
            return $string;
        } else {
            return false;
        }
    }
public function charsWhile ( $ bytes , $ max = null ) { if ( $ this -> char < $ this -> EOF ) { if ( $ max === 0 || $ max ) { $ len = strspn ( $ this -> data , $ bytes , $ this -> char , $ max ) ; } else { $ len = strspn ( $ this -> data , $ bytes , $ this -> char ) ; } $ string = ( string ) substr ( $ this -> data , $ this -> char , $ len ) ; $ this -> char += $ len ; return $ string ; } else { return false ; } }
Matches as far as possible with a certain set of bytes
and returns the matched substring.

@param $bytes | Bytes to match.
@param null $max
@return bool|string
Matches as far as possible with a certain set of bytes and returns the matched substring .