1--TEST-- 2timezone_offset_get() tests 3--FILE-- 4<?php 5date_default_timezone_set('UTC'); 6 7$dto = date_create("2006-12-12"); 8var_dump($dto); 9 10$dtz = date_timezone_get($dto); 11var_dump($dtz); 12 13var_dump(timezone_offset_get()); 14var_dump(timezone_offset_get($dtz, $dto)); 15var_dump(timezone_offset_get($dto, $dtz)); 16 17echo "Done\n"; 18 19?> 20--EXPECTF-- 21object(DateTime)#%d (3) { 22 ["date"]=> 23 string(19) "2006-12-12 00:00:00" 24 ["timezone_type"]=> 25 int(3) 26 ["timezone"]=> 27 string(3) "UTC" 28} 29object(DateTimeZone)#%d (0) { 30} 31 32Warning: timezone_offset_get() expects exactly 2 parameters, 0 given in %s on line %d 33bool(false) 34int(0) 35 36Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, object given in %s on line %d 37bool(false) 38Done 39