1--TEST-- 2Test DateTimeZone::getTransitions() function : basic functionality 3--FILE-- 4<?php 5echo "*** Testing DateTimeZone::getTransitions() : basic functionality ***\n"; 6 7//Set the default time zone 8date_default_timezone_set("Europe/London"); 9 10// Create a DateTimeZone object 11$tz = new DateTimeZone("Europe/London"); 12 13$tran = $tz->getTransitions(-306972000, -37241999); 14 15if (!is_array($tran)) { 16 echo "TEST FAILED: Expected an array\n"; 17} 18 19echo "\n-- Total number of transitions: " . count($tran). " --\n"; 20 21echo "\n-- Format a sample entry for Spring 1963 --\n"; 22var_dump( $tran[6] ); 23 24?> 25--EXPECT-- 26*** Testing DateTimeZone::getTransitions() : basic functionality *** 27 28-- Total number of transitions: 18 -- 29 30-- Format a sample entry for Spring 1963 -- 31array(5) { 32 ["ts"]=> 33 int(-213228000) 34 ["time"]=> 35 string(24) "1963-03-31T02:00:00+0000" 36 ["offset"]=> 37 int(3600) 38 ["isdst"]=> 39 bool(true) 40 ["abbr"]=> 41 string(3) "BST" 42} 43