1--TEST-- 2IntlTimeZone::hasSameRules(): 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 11function error_handler($errno, $errstr, $errfile, $errline) 12{ 13 var_dump($errno, $errstr); 14 return true; 15} 16set_error_handler("error_handler"); 17 18$tz = IntlTimeZone::createTimeZone('Europe/Lisbon'); 19try { 20 var_dump($tz->hasSameRules('foo')); 21} catch (Error $ex) { 22 var_dump($ex->getCode(), $ex->getMessage()); 23 echo "\n"; 24} 25 26try { 27 var_dump(intltz_has_same_rules(null, $tz)); 28} catch (Error $ex) { 29 var_dump($ex->getCode(), $ex->getMessage()); 30 echo "\n"; 31} 32--EXPECT-- 33int(0) 34string(99) "Argument 1 passed to IntlTimeZone::hasSameRules() must be an instance of IntlTimeZone, string given" 35 36int(0) 37string(92) "Argument 1 passed to intltz_has_same_rules() must be an instance of IntlTimeZone, null given" 38