1--TEST-- 2IntlCalendar::setTimeZone(): bad arguments 3--INI-- 4date.timezone=Atlantic/Azores 5--EXTENSIONS-- 6intl 7--FILE-- 8<?php 9ini_set("intl.error_level", E_WARNING); 10 11$c = new IntlGregorianCalendar(NULL, 'pt_PT'); 12 13$gmt = IntlTimeZone::getGMT(); 14 15function eh($errno, $errstr) { 16echo "error: $errno, $errstr\n"; 17} 18set_error_handler('eh'); 19 20try { 21 var_dump($c->setTimeZone($gmt, 2)); 22} catch (Error $ex) { 23 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 24} 25try { 26 var_dump($c->setTimeZone()); 27} catch (Error $ex) { 28 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 29} 30 31try{ 32 var_dump(intlcal_set_time_zone($c, 1, 2)); 33} catch (Error $ex) { 34 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 35} 36try{ 37 var_dump(intlcal_set_time_zone(1, $gmt)); 38} catch (Error $ex) { 39 echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; 40} 41?> 42--EXPECT-- 43error: 0, IntlCalendar::setTimeZone() expects exactly 1 argument, 2 given 44 45error: 0, IntlCalendar::setTimeZone() expects exactly 1 argument, 0 given 46 47error: 0, intlcal_set_time_zone() expects exactly 2 arguments, 3 given 48 49error: 0, intlcal_set_time_zone(): Argument #1 ($calendar) must be of type IntlCalendar, int given 50