1--TEST--
2IntlTimeZone::getOffset(): errors
3--SKIPIF--
4<?php
5if (!extension_loaded('intl'))
6    die('skip intl extension not enabled');
7
8/* INF being an invalid offset depends on UB in float->int cast behavior. */
9$arch = php_uname('m');
10if ($arch != 'x86_64' && $arch != 'i386')
11    die('skip requires x86');
12?>
13--FILE--
14<?php
15ini_set("intl.error_level", E_WARNING);
16
17$tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
18var_dump($tz->getOffset(INF, true, $a, $a));
19
20intltz_get_offset(null, time()*1000, false, $a, $a);
21?>
22--EXPECTF--
23Warning: IntlTimeZone::getOffset(): intltz_get_offset: error obtaining offset in %s on line %d
24bool(false)
25
26Fatal error: Uncaught TypeError: intltz_get_offset(): Argument #1 ($timezone) must be of type IntlTimeZone, null given in %s:%d
27Stack trace:
28#0 %s(%d): intltz_get_offset(NULL, %d, false, NULL, NULL)
29#1 {main}
30  thrown in %s on line %d
31