public function checkTag($expectTag, $tag = null) { if ($tag === null) { $tag = $this->stream->getc(); } if ($tag != $expectTag) { throw $this->unexpectedTag($tag, $expectTag); } }