1--TEST-- 2IntlTimeZone::getErrorCode/Message(): basic test 3--EXTENSIONS-- 4intl 5--SKIPIF-- 6<?php 7/* INF being an invalid offset depends on UB in float->int cast behavior. */ 8$arch = php_uname('m'); 9if ($arch != 'x86_64' && $arch != 'i386') 10 die('skip requires x86'); 11?> 12--FILE-- 13<?php 14ini_set("intl.error_level", E_WARNING); 15 16$lsb = IntlTimeZone::createTimeZone('Europe/Lisbon'); 17 18var_dump($lsb->getErrorCode()); 19var_dump($lsb->getErrorMessage()); 20 21var_dump($lsb->getOffset(INF, 1, $a, $b)); 22 23var_dump($lsb->getErrorCode()); 24var_dump($lsb->getErrorMessage()); 25 26?> 27--EXPECTF-- 28int(0) 29string(12) "U_ZERO_ERROR" 30 31Warning: IntlTimeZone::getOffset(): error obtaining offset in %s on line %d 32bool(false) 33int(1) 34string(48) "error obtaining offset: U_ILLEGAL_ARGUMENT_ERROR" 35