php-src/ext/date/tests/68062.phpt
Florian MARGAINE 9680829389 DateTimeZone::getOffset() now accepts a DateTimeInterface
Fixes #68062

Should be backported to PHP-5.6 and PHP-5.5.

Conflicts:
	ext/date/tests/bug67118.phpt
2014-10-04 16:06:04 +01:00

14 lines
343 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);
echo $tz->getOffset(1);
--EXPECTF--
3600
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s