title: PHP 7.2 deprecated: while = each() loop without $value
body: <p>As <strong>each()</strong> loop is deprecated since <strong>PHP 7.2</strong>, how to update the below <strong>while(() = each())</strong> loop without $value? </p>
  
  <p>Without the <strong>$value</strong> I can't get foreach loop to work. In addition <strong>while($products_id = $this->contents)</strong> results in infinite loop. </p>
  
  <p>Thank you!</p>
  
  <pre><code>$total_items = 0;
  
  reset($this-&gt;contents);
  while (list($products_id, ) = each($this-&gt;contents)) {
      $total_items += $this-&gt;get_quantity($products_id);
  }
  </code></pre>