next_basic.phpt 568 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Test next() function : basic functionality
  3. --FILE--
  4. <?php
  5. /*
  6. * Test basic functionality of next()
  7. */
  8. echo "*** Testing next() : basic functionality ***\n";
  9. $array = array('zero', 'one', 'two');
  10. echo key($array) . " => " . current($array) . "\n";
  11. var_dump(next($array));
  12. echo key($array) . " => " . current($array) . "\n";
  13. var_dump(next($array));
  14. echo key($array) . " => " . current($array) . "\n";
  15. var_dump(next($array));
  16. ?>
  17. --EXPECT--
  18. *** Testing next() : basic functionality ***
  19. 0 => zero
  20. string(3) "one"
  21. 1 => one
  22. string(3) "two"
  23. 2 => two
  24. bool(false)