title: PHP Notice: String offset cast occurred line 251 & 258
body: <p>i get php notice with this</p>
  
  <pre><code>$code = "";
  while ($id &gt; $length - 1) {
      // determine the value of the next higher character
      // in the short code should be and prepend
      $code = self::$chars[fmod($id, $length)] . $code; //&lt;-- line 251
      // reset $id to remaining value to be converted
      $id = floor($id / $length);
  }
  
  // remaining value of $id is less than the length of
  // self::$chars
  $code = self::$chars[$id] . $code; //&lt;-- line 258
  
  return $code;
  </code></pre>
  
  <p>The NOTICE code is this part:</p>
  
  <pre><code>$code = self::$chars[fmod($id, $length)] . $code; 
  $code = self::$chars[$id] . $code; 
  </code></pre>
  
  <p>How to fix it? I can’t find it, please your help all.. :)</p>