1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 16:08:35 +02:00
Files
archived-php-src/ext/date/tests/68062.phpt
T
2019-03-11 11:32:20 +01:00

18 lines
399 B
PHP

--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