1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 22:41:20 +02:00
Files
archived-php-src/ext/date/tests/68062.phpt
Máté Kocsis 960318ed95 Change argument error message format
Closes GH-5211
2020-02-26 15:00:08 +01:00

18 lines
414 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(): Argument #1 ($datetime) must be of type DateTimeInterface, int given