1--TEST-- 2IntlCalendar::set(): bad arguments 3--INI-- 4date.timezone=Atlantic/Azores 5--EXTENSIONS-- 6intl 7--FILE-- 8<?php 9ini_set("intl.error_level", E_WARNING); 10 11$c = new IntlGregorianCalendar(NULL, 'pt_PT'); 12 13try { 14 $c->set(1, 2, 3, 4, 5, 6, 7); 15} catch (ArgumentCountError $exception) { 16 echo $exception->getMessage() . "\n"; 17} 18 19try { 20 $c->set(1, 2, 3, 4); 21} catch (ArgumentCountError $exception) { 22 echo $exception->getMessage() . "\n"; 23} 24 25try { 26 var_dump($c->set(-1, 2)); 27} catch (\ValueError $e) { 28 echo $e->getMessage() . \PHP_EOL; 29} 30 31try { 32 var_dump(intlcal_set($c, -1, 2)); 33} catch (\ValueError $e) { 34 echo $e->getMessage() . \PHP_EOL; 35} 36 37try { 38 var_dump(intlcal_set(1, 2, 3)); 39} catch (\TypeError $e) { 40 echo $e->getMessage() . \PHP_EOL; 41} 42?> 43--EXPECTF-- 44Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d 45IntlCalendar::set() expects at most 6 arguments, 7 given 46 47Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d 48IntlCalendar::set() has no variant with exactly 4 parameters 49IntlCalendar::set(): Argument #1 ($year) must be a valid field 50 51Deprecated: Function intlcal_set() is deprecated since 8.4, use IntlCalendar::set(), IntlCalendar::setDate(), or IntlCalendar::setDateTime() instead in %s on line %d 52intlcal_set(): Argument #2 ($year) must be a valid field 53 54Deprecated: Function intlcal_set() is deprecated since 8.4, use IntlCalendar::set(), IntlCalendar::setDate(), or IntlCalendar::setDateTime() instead in %s on line %d 55intlcal_set(): Argument #1 ($calendar) must be of type IntlCalendar, int given 56