title: How to fix "A non-numeric value encountered" warning?
body: <p>I have migrated from PHP 5.x to PHP 7.3 and I am unable to understand how to fix this function I use extensively:</p>
  <pre><code>function md5_decrypt($enc_text, $salt, $iv_len = 16)
  {
     $enc_text = base64_decode($enc_text);
     $n = strlen($enc_text);
     $i = $iv_len;
     $plain_text = '';   
     $iv = substr($salt ^ substr($enc_text, 0, $iv_len), 0, 512);
     while ($i &lt; $n) {
         $block = substr($enc_text, $i, 16);
         $plain_text .= $block ^ pack('H*', md5($iv));
         $iv = substr($block . $iv, 0, 512) ^ $salt;
         $i += 16;
     }
     return preg_replace('/\\x13\\x00*$/', '', $plain_text);
  }
  </code></pre>
  <p>PHP 7.3 gives me the &quot;PHP Warning:  A non-numeric value encountered in line 7&quot; error:</p>
  <pre><code>$iv = substr($salt ^ substr($enc_text, 0, $iv_len), 0, 512);
  </code></pre>
  <p>I understand that what substr() is returning is a string and must be translated into a numeric variable, but how to do it without breaking the code?</p>
  <p>Any suggestions are very welcome!</p>
  <p>Thank you in advance to everyone.</p>
  <p>All the best,
  Fab.</p>