gettimeofday_error.phpt 819 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Test gettimeofday() function : error conditions
  3. --FILE--
  4. <?php
  5. /* Prototype : array gettimeofday([bool get_as_float])
  6. * Description: Returns the current time as array
  7. * Source code: ext/standard/microtime.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing gettimeofday() : error conditions ***\n";
  11. //Test gettimeofday with one more than the expected number of arguments
  12. echo "\n-- Testing gettimeofday() function with more than expected no. of arguments --\n";
  13. $get_as_float = true;
  14. $extra_arg = 10;
  15. var_dump( gettimeofday($get_as_float, $extra_arg) );
  16. ?>
  17. ===DONE===
  18. --EXPECTF--
  19. *** Testing gettimeofday() : error conditions ***
  20. -- Testing gettimeofday() function with more than expected no. of arguments --
  21. Warning: gettimeofday() expects at most 1 parameter, 2 given in %s on line %d
  22. NULL
  23. ===DONE===