title: Fatal error: Uncaught TypeError: Unsupported operand types: string + int in
body: <p>This is my error tittle:</p>
  <blockquote>
  <p>Fatal error: Uncaught TypeError: Unsupported operand types: string + int in C:\xamppp\htdocs\file\thefile\config.php:105 Stack trace: #0 C:\xamppp\htdocs\file\thefile\category.php(84): alphaID('f', true) #1 {main} thrown in C:\xamppp\htdocs\file\thefile\config.php on line 105</p>
  </blockquote>
  <p>The error on line 105:</p>
  <pre><code>{$out = $out + strpos($index, substr($in, $t, 1)) * $bcp;}
  </code></pre>
  <p>And this is the codes:</p>
  <pre><code>&lt;?php
  
  //fungsi encrypt id
  function alphaID($in, $to_num = false, $pad_up = false, $pass_key = null)
  {
    $out   =   '';
    $index = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $base  = strlen($index);
  
    if ($pass_key !== null) {
  
      for ($n = 0; $n &lt; strlen($index); $n++) {
        $i[] = substr($index, $n, 1);
      }
  
      $pass_hash = hash('sha256',$pass_key);
      $pass_hash = (strlen($pass_hash) &lt; strlen($index) ? hash('sha512', $pass_key) : $pass_hash);
  
      for ($n = 0; $n &lt; strlen($index); $n++) {
        $p[] =  substr($pass_hash, $n, 1);
      }
  
      array_multisort($p, SORT_DESC, $i);
      $index = implode($i);
    }
  
    if ($to_num) {
      $len = strlen($in) - 1;
  
      for ($t = $len; $t &gt;= 0; $t--) {
        $bcp = bcpow($base, $len - $t);
        $out = $out + strpos($index, substr($in, $t, 1)) * $bcp;
      }
  
      if (is_numeric($pad_up)) {
        $pad_up--;
  
        if ($pad_up &gt; 0) {
          $out -= pow($base, $pad_up);
        }
      }
    } else {
      if (is_numeric($pad_up)) {
        $pad_up--;
  
        if ($pad_up &gt; 0) {
          $in += pow($base, $pad_up);
        }
      }
  
      for ($t = ($in != 0 ? floor(log($in, $base)) : 0); $t &gt;= 0; $t--) {
        $bcp = bcpow($base, $t);
        $a   = floor($in / $bcp) % $base;
        $out = $out . substr($index, $a, 1);
        $in  = $in - ($a * $bcp);
      }
    }
  
    return $out;
  }
  ?&gt;
  </code></pre>