title: php 7.1 warning "A non-numeric value" only for numeric values "0-4"
body: <p>I have the following working code:</p>
  
  <pre><code>$nif = 'A12345678';
  
  $even = $nif[2] + $nif[4] + $nif[6];
  
  for ($i = 1; $i &lt; 8; $i += 2)
  {
      echo $nif[$i];
      $even += substr((2 * $nif[$i]), 0, 1) + substr((2 * $nif[$i]), 1, 1);
  }
  </code></pre>
  
  <p>Output for PHP 7.0.14</p>
  
  <pre><code>1357
  </code></pre>
  
  <p>Output for PHP 7.1</p>
  
  <pre><code>1&lt;br /&gt;
  &lt;b&gt;Warning&lt;/b&gt;:  A non-numeric value encountered in &lt;b&gt;[...][...]&lt;/b&gt; on line &lt;b&gt;22&lt;/b&gt;&lt;br /&gt;
  3&lt;br /&gt;
  &lt;b&gt;Warning&lt;/b&gt;:  A non-numeric value encountered in &lt;b&gt;[...][...]&lt;/b&gt; on line &lt;b&gt;22&lt;/b&gt;&lt;br /&gt;
  57
  </code></pre>
  
  <p>Now if I change the value of <code>$nif</code> to:</p>
  
  <pre><code>$nif = 'A52545678';
  </code></pre>
  
  <p>The output for 7.1 would be:</p>
  
  <pre><code>5557
  </code></pre>
  
  <p>Already tried passing a normal variable to <code>substr()</code> but that's not the problem:</p>
  
  <pre><code>$a = $nif[$i];
  $even += substr((2 * $a), 0, 1) + substr((2 * $a), 1, 1);
  </code></pre>
  
  <p>Why is PHP 7.1 or <code>substr()</code> from PHP 7.1 treating numeric values in the range <code>'0-4'</code> as non-numeric values?</p>