1--TEST-- 2IntlCalendar::isWeekend(): bad arguments 3--INI-- 4date.timezone=Atlantic/Azores 5--SKIPIF-- 6<?php 7if (!extension_loaded('intl')) 8 die('skip intl extension not enabled'); 9if (version_compare(INTL_ICU_VERSION, '4.4') < 0) 10 die('skip for ICU 4.4+'); 11--FILE-- 12<?php 13ini_set("intl.error_level", E_WARNING); 14 15$c = new IntlGregorianCalendar(NULL, 'pt_PT'); 16 17var_dump($c->isWeekend(1, 2)); 18var_dump($c->isWeekend("jhhk")); 19 20var_dump(intlcal_is_weekend($c, "jj")); 21var_dump(intlcal_is_weekend(1)); 22--EXPECTF-- 23Warning: IntlCalendar::isWeekend() expects at most 1 parameter, 2 given in %s on line %d 24 25Warning: IntlCalendar::isWeekend(): intlcal_is_weekend: bad arguments in %s on line %d 26bool(false) 27 28Warning: IntlCalendar::isWeekend() expects parameter 1 to be float, string given in %s on line %d 29 30Warning: IntlCalendar::isWeekend(): intlcal_is_weekend: bad arguments in %s on line %d 31bool(false) 32 33Warning: intlcal_is_weekend() expects parameter 2 to be float, string given in %s on line %d 34 35Warning: intlcal_is_weekend(): intlcal_is_weekend: bad arguments in %s on line %d 36bool(false) 37 38Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_is_weekend() must be an instance of IntlCalendar, int given in %s:%d 39Stack trace: 40#0 %s(%d): intlcal_is_weekend(1) 41#1 {main} 42 thrown in %s on line %d 43