public function lsr($n) { if ($this->offset >= $n) { $res = new Binary($this->getBytes(), $this->getSize()); $res->addOffset(-$n); return $res; } $n -= $this->offset; if ($n >= count($this->getBytes())) { return new BytesBinary(array(), $this->getSize()); } return new Binary(array_slice($this->getBytes(), $n), $this->getSize()); }