xref: /PHP-8.1/ext/date/tests/bug44742.phpt (revision f8d79582)
1--TEST--
2Bug #44742 (timezone_offset_get() causes segmentation faults)
3--FILE--
4<?php
5date_default_timezone_set('Europe/London');
6$dates = array(
7    "2008-04-11 00:00:00+0000",
8    "2008-04-11 00:00:00+0200",
9    "2008-04-11 00:00:00+0330",
10    "2008-04-11 00:00:00-0500",
11    "2008-04-11 00:00:00-1130",
12    "2008-04-11 00:00:00 CEST",
13    "2008-04-11 00:00:00 CET",
14    "2008-04-11 00:00:00 UTC",
15    "2008-04-11 00:00:00 America/New_York",
16    "2008-04-11 00:00:00 Europe/Oslo",
17    "2008-04-11 00:00:00 Asia/Singapore",
18);
19foreach ($dates as $date)
20{
21    $date = date_create($date);
22    var_dump(timezone_offset_get(date_timezone_get($date), $date));
23}
24?>
25--EXPECT--
26int(0)
27int(7200)
28int(12600)
29int(-18000)
30int(-41400)
31int(7200)
32int(3600)
33int(0)
34int(-14400)
35int(7200)
36int(28800)
37