php_parser.php
public function match($subject, &$match)
    {
        if (count($this->patterns) === 0) {
            return false;
        }
        if (! preg_match($this->getCompoundedRegex(), $subject, $matches)) {
            $match = '';

            return false;
        }
        $match = $matches[0];
        for ($i = 1; $i < count($matches); $i++) {
            if ($matches[$i]) {
                return $this->labels[$i - 1];
            }
        }

        return true;
    }
public function match($subject, &$match)
    {
        if (count($this->patterns) === 0) {
            return false;
        }
        if (! preg_match($this->getCompoundedRegex(), $subject, $matches)) {
            $match = '';

            return false;
        }
        $match = $matches[0];
        for ($i = 1; $i < count($matches); $i++) {
            if ($matches[$i]) {
                return $this->labels[$i - 1];
            }
        }

        return true;
    }
Attempts to match all patterns at once against a string.

@param string $subject      String to match against.
@param string $match        First matched portion of subject.

@return bool             True on success.