1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 21:11:02 +02:00
Files
archived-php-src/ext/intl/tests/gregoriancalendar___construct_error.phpt
Nikita Popov 4903f7c5fd Fix IntlGregorianCalendar constructor signature
Give these conversative UNKNOWN defaults and no types, as the
overload is something of a mess.
2020-07-17 12:47:25 +02:00

42 lines
1.1 KiB
PHP

--TEST--
IntlGregorianCalendar::__construct(): bad arguments
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
try {
var_dump(intlgregcal_create_instance(1,2,3,4,5,6,7));
} catch (ArgumentCountError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(intlgregcal_create_instance(1,2,3,4,5,6,7,8));
} catch (ArgumentCountError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(intlgregcal_create_instance(1,2,3,4));
} catch (ArgumentCountError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(new IntlGregorianCalendar(1,2,NULL,4));
} catch (ArgumentCountError $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump(new IntlGregorianCalendar(1,2,3,4,NULL,array()));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
--EXPECT--
Too many arguments
Too many arguments
No variant with 4 arguments (excluding trailing NULLs)
No variant with 4 arguments (excluding trailing NULLs)
IntlGregorianCalendar::__construct(): Argument #6 ($second) must be of type int, array given