protected function match($code, $line)
    {
        foreach ($this->patterns as $token => $pattern) {
            if (!preg_match($pattern, $code, $matches)) {
                continue;
            }

            return new Token($token, $matches[1], $line);
        }

        return false;
    }
protected function match($code, $line)
    {
        foreach ($this->patterns as $token => $pattern) {
            if (!preg_match($pattern, $code, $matches)) {
                continue;
            }

            return new Token($token, $matches[1], $line);
        }

        return false;
    }
protected function match ( $ code , $ line ) { foreach ( $ this -> patterns as $ token => $ pattern ) { if ( ! preg_match ( $ pattern , $ code , $ matches ) ) { continue ; } return new Token ( $ token , $ matches [ 1 ] , $ line ) ; } return false ; }
Returns matched token or false

@param string  $code
@param integer $line

@return Token|boolean Token object otherwise false
Returns matched token or false