1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/intl/tests/calendar_getKeywordValuesForLocale_error.phpt
T
Gabriel Caruso fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00

27 lines
908 B
PHP

--TEST--
IntlCalendar::getKeywordValuesForLocale(): bad arguments
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
if (version_compare(INTL_ICU_VERSION, '4.2') < 0)
die('skip for ICU 4.2+');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_keyword_values_for_locale(1, 2));
var_dump(IntlCalendar::getKeywordValuesForLocale(1, 2, array()));
--EXPECTF--
Warning: intlcal_get_keyword_values_for_locale() expects exactly 3 parameters, 2 given in %s on line %d
Warning: intlcal_get_keyword_values_for_locale(): intlcal_get_keyword_values_for_locale: bad arguments in %s on line %d
bool(false)
Warning: IntlCalendar::getKeywordValuesForLocale() expects parameter 3 to be bool, array given in %s on line %d
Warning: IntlCalendar::getKeywordValuesForLocale(): intlcal_get_keyword_values_for_locale: bad arguments in %s on line %d
bool(false)