1--TEST-- 2IntlTimeZone::getDisplayName(): errors 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 11$tz = IntlTimeZone::createTimeZone('Europe/Lisbon'); 12var_dump($tz->getDisplayName(array())); 13var_dump($tz->getDisplayName(false, array())); 14var_dump($tz->getDisplayName(false, -1)); 15var_dump($tz->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT, array())); 16var_dump($tz->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT, NULL, NULL)); 17 18var_dump(intltz_get_display_name(null, IntlTimeZone::DISPLAY_SHORT, false, 'pt_PT')); 19--EXPECTF-- 20Warning: IntlTimeZone::getDisplayName() expects parameter 1 to be boolean, array given in %s on line %d 21 22Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d 23bool(false) 24 25Warning: IntlTimeZone::getDisplayName() expects parameter 2 to be integer, array given in %s on line %d 26 27Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d 28bool(false) 29 30Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: wrong display type in %s on line %d 31bool(false) 32 33Warning: IntlTimeZone::getDisplayName() expects parameter 3 to be string, array given in %s on line %d 34 35Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d 36bool(false) 37 38Warning: IntlTimeZone::getDisplayName() expects at most 3 parameters, 4 given in %s on line %d 39 40Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d 41bool(false) 42 43Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_display_name() must be an instance of IntlTimeZone, null given in %s:%d 44Stack trace: 45#0 %s(%d): intltz_get_display_name(NULL, 1, false, 'pt_PT') 46#1 {main} 47 thrown in %s on line %d 48