2) { $last = array_pop($expected); $expected = implode(', ', $expected) . ', or ' . $last; } else { $expected = implode(' or ', $expected); } } } else { $expected = ($expected !== false) ? $expected : 'end of input'; } $found = ($found !== false) ? "\"$found\"" : 'end of input'; parent::__construct(sprintf(self::MESSAGE, $expected, $found, $offset), 2112); } }