date_create_error.phpt 818 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Test date_create() function : error conditions
  3. --FILE--
  4. <?php
  5. /* Prototype : DateTime date_create ([ string $time [, DateTimeZone $timezone ]] )
  6. * Description: Returns new DateTime object
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions: DateTime::__construct
  9. */
  10. echo "*** Testing date_create() : error conditions ***\n";
  11. echo "\n-- Testing date_create() function with more than expected no. of arguments --\n";
  12. $time = "GMT";
  13. $timezone = timezone_open("GMT");
  14. $extra_arg = 99;
  15. var_dump( date_create($time, $timezone, $extra_arg) );
  16. ?>
  17. ===DONE===
  18. --EXPECTF--
  19. *** Testing date_create() : error conditions ***
  20. -- Testing date_create() function with more than expected no. of arguments --
  21. Warning: date_create() expects at most 2 parameters, 3 given in %s on line %d
  22. bool(false)
  23. ===DONE===