1--TEST--
2IntlTimeZone::getOffset(): errors
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$tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
17var_dump($tz->getOffset(INF, true, $a, $a));
18
19intltz_get_offset(null, time()*1000, false, $a, $a);
20?>
21--EXPECTF--
22Warning: IntlTimeZone::getOffset(): error obtaining offset in %s on line %d
23bool(false)
24
25Fatal error: Uncaught TypeError: intltz_get_offset(): Argument #1 ($timezone) must be of type IntlTimeZone, null given in %s:%d
26Stack trace:
27#0 %s(%d): intltz_get_offset(NULL, %f, false, NULL, NULL)
28#1 {main}
29  thrown in %s on line %d
30