public function encode() { parent::encode(); $this->putLTriad($this->seqNumber); foreach ($this->packets as $packet) { $this->put($packet instanceof EncapsulatedPacket ? $packet->toBinary() : (string) $packet); } }