fork(1) download
  1. <?php
  2.  
  3. $array = array(
  4. 'teste' => '1',
  5. 'teste2' => '2'
  6. );
  7. while (list($key, $value) = each($array)) {
  8. echo $key . "\n";
  9. }
  10. echo "------------\n";
  11.  
  12. $array = array(
  13. 'teste' => '1',
  14. 'teste2' => '2'
  15. );
  16. while ($value = current($array)) {
  17. echo key($array) . "\n";
  18. next($array);
  19. }
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
teste
teste2
------------
teste
teste2