1--TEST--
2IntlGregorianCalendar::__construct(): bad arguments
3--SKIPIF--
4<?php
5if (!extension_loaded('intl'))
6	die('skip intl extension not enabled');
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10
11function print_exception($e) {
12	echo "\nException: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n";
13}
14
15var_dump(intlgregcal_create_instance(1,2,3,4,5,6,7));
16var_dump(intlgregcal_create_instance(1,2,3,4,5,6,7,8));
17var_dump(intlgregcal_create_instance(1,2,3,4));
18try {
19	var_dump(new IntlGregorianCalendar(1,2,NULL,4));
20} catch (IntlException $e) {
21	print_exception($e);
22}
23try {
24	var_dump(new IntlGregorianCalendar(1,2,3,4,NULL,array()));
25} catch (TypeError $e) {
26	print_exception($e);
27}
28--EXPECTF--
29Warning: intlgregcal_create_instance(): intlgregcal_create_instance: too many arguments in %s on line %d
30NULL
31
32Warning: intlgregcal_create_instance(): intlgregcal_create_instance: too many arguments in %s on line %d
33NULL
34
35Warning: intlgregcal_create_instance(): intlgregcal_create_instance: no variant with 4 arguments (excluding trailing NULLs) in %s on line %d
36NULL
37
38Exception: IntlGregorianCalendar::__construct(): intlgregcal_create_instance: no variant with 4 arguments (excluding trailing NULLs) in %s on line %d
39
40Exception: IntlGregorianCalendar::__construct() expects parameter 6 to be int, array given in %s on line %d
41