current_basic.phpt 695 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Test current() function : basic functionality
  3. --FILE--
  4. <?php
  5. /* Prototype : mixed current(array $array_arg)
  6. * Description: Return the element currently pointed to by the internal array pointer
  7. * Source code: ext/standard/array.c
  8. */
  9. /*
  10. * Test basic functionality of current()
  11. */
  12. echo "*** Testing current() : basic functionality ***\n";
  13. $array = array ('zero', 'one', 'two', 'three' => 3);
  14. var_dump(current($array));
  15. next($array);
  16. var_dump(current($array));
  17. end($array);
  18. var_dump(current($array));
  19. next($array);
  20. var_dump(current($array));
  21. ?>
  22. ===DONE===
  23. --EXPECTF--
  24. *** Testing current() : basic functionality ***
  25. string(4) "zero"
  26. string(3) "one"
  27. int(3)
  28. bool(false)
  29. ===DONE===