calendar_createInstance_error.phpt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. IntlCalendar::createInstance: bad arguments
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. --FILE--
  8. <?php
  9. ini_set("intl.error_level", E_WARNING);
  10. class X extends IntlTimeZone {
  11. function __construct() {}
  12. }
  13. var_dump(IntlCalendar::createInstance(1, 2, 3));
  14. var_dump(intlcal_create_instance(1, 2, 3));
  15. var_dump(intlcal_create_instance(new X, NULL));
  16. var_dump(intlcal_create_instance(NULL, array()));
  17. --EXPECTF--
  18. Warning: IntlCalendar::createInstance() expects at most 2 parameters, 3 given in %s on line %d
  19. Warning: IntlCalendar::createInstance(): intlcal_create_calendar: bad arguments in %s on line %d
  20. NULL
  21. Warning: intlcal_create_instance() expects at most 2 parameters, 3 given in %s on line %d
  22. Warning: intlcal_create_instance(): intlcal_create_calendar: bad arguments in %s on line %d
  23. NULL
  24. Warning: intlcal_create_instance(): intlcal_create_instance: passed IntlTimeZone is not properly constructed in %s on line %d
  25. NULL
  26. Warning: intlcal_create_instance() expects parameter 2 to be string, array given in %s on line %d
  27. Warning: intlcal_create_instance(): intlcal_create_calendar: bad arguments in %s on line %d
  28. NULL