summaryrefslogtreecommitdiff
path: root/ext/date/tests/68062.phpt
blob: 1270382158a8a7fa0ab66003b26ece1c44cea55e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
DateTimeZone::getOffset() accepts a DateTimeInterface object
--FILE--
<?php

$tz = new DateTimeZone('Europe/London');
$dt = new DateTimeImmutable('2014-09-20', $tz);

echo $tz->getOffset($dt), "\n";
try {
    echo $tz->getOffset(1);
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}
--EXPECT--
3600
DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, int given