1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 07:28:09 +02:00
Files
archived-php-src/ext/date/tests/68062.phpt
T
Máté Kocsis d6264b0966 Verify parameter names of function aliases
Closes GH-6335
2020-10-16 10:56:33 +02:00

19 lines
417 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