src/Binary/SizeCalculator.php
public function computeStringSize($value)
    {
        $length = mb_strlen($value, '8bit');
        $size   = $length + $this->computeVarintSize($length);

        return $size;
    }
public function computeStringSize($value)
    {
        $length = mb_strlen($value, '8bit');
        $size   = $length + $this->computeVarintSize($length);

        return $size;
    }
public function computeStringSize ( $ value ) { $ length = mb_strlen ( $ value , '8bit' ) ; $ size = $ length + $ this -> computeVarintSize ( $ length ) ; return $ size ; }
Compute the number of bytes that would be needed to encode a string.

@param integer $value

@return integer
Compute the number of bytes that would be needed to encode a string .