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-- 29 30Warning: intlgregcal_create_instance(): intlgregcal_create_instance: too many arguments in %s on line %d 31NULL 32 33Warning: intlgregcal_create_instance(): intlgregcal_create_instance: too many arguments in %s on line %d 34NULL 35 36Warning: intlgregcal_create_instance(): intlgregcal_create_instance: no variant with 4 arguments (excluding trailing NULLs) in %s on line %d 37NULL 38 39Exception: IntlGregorianCalendar::__construct(): intlgregcal_create_instance: no variant with 4 arguments (excluding trailing NULLs) in %s on line %d 40 41Exception: IntlGregorianCalendar::__construct() expects parameter 6 to be integer, array given in %s on line %d 42