1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00
Files
archived-php-src/ext/date/tests/014.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

41 lines
829 B
PHP

--TEST--
timezone_offset_get() tests
--FILE--
<?php
date_default_timezone_set('UTC');
$dto = date_create("2006-12-12");
var_dump($dto);
$dtz = date_timezone_get($dto);
var_dump($dtz);
var_dump(timezone_offset_get());
var_dump(timezone_offset_get($dtz, $dto));
var_dump(timezone_offset_get($dto, $dtz));
echo "Done\n";
?>
--EXPECTF--
object(DateTime)#%d (3) {
["date"]=>
string(26) "2006-12-12 00:00:00.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
object(DateTimeZone)#%d (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
Warning: timezone_offset_get() expects exactly 2 parameters, 0 given in %s on line %d
bool(false)
int(0)
Catchable fatal error: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of DateTime given in %s