1--TEST-- 2IntlTimeZone::hasSameRules(): errors 3--EXTENSIONS-- 4intl 5--FILE-- 6<?php 7ini_set("intl.error_level", E_WARNING); 8 9function error_handler($errno, $errstr, $errfile, $errline) 10{ 11 var_dump($errno, $errstr); 12 return true; 13} 14set_error_handler("error_handler"); 15 16$tz = IntlTimeZone::createTimeZone('Europe/Lisbon'); 17try { 18 var_dump($tz->hasSameRules('foo')); 19} catch (Error $ex) { 20 var_dump($ex->getCode(), $ex->getMessage()); 21 echo "\n"; 22} 23 24try { 25 var_dump(intltz_has_same_rules(null, $tz)); 26} catch (Error $ex) { 27 var_dump($ex->getCode(), $ex->getMessage()); 28 echo "\n"; 29} 30?> 31--EXPECT-- 32int(0) 33string(93) "IntlTimeZone::hasSameRules(): Argument #1 ($other) must be of type IntlTimeZone, string given" 34 35int(0) 36string(89) "intltz_has_same_rules(): Argument #1 ($timezone) must be of type IntlTimeZone, null given" 37