fork(4) download
  1. <?php
  2.  
  3.  
  4. $array = [0, 1, 2];
  5. foreach ($array as $val) {
  6. //reset($array);
  7. var_dump(current($array));
  8. var_dump($val);
  9. }
  10.  
Success #stdin #stdout 0.02s 82560KB
stdin
Standard input is empty
stdout
int(0)
int(0)
int(0)
int(1)
int(0)
int(2)