Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / date / tests / timezone_transitions_get_basic1.phpt
blobeb6cf9934255075b9a988e5fa2ae1baa79e4fb0a
1 --TEST--
2 Test timezone_transitions_get() function : basic functionality 
3 --FILE--
4 <?php
5 /* Prototype  : array timezone_transitions_get  ( DateTimeZone $object, [ int $timestamp_begin  [, int $timestamp_end  ]]  )
6  * Description: Returns all transitions for the timezone
7  * Source code: ext/date/php_date.c
8  * Alias to functions: DateTimeZone::getTransitions()
9  */
11 echo "*** Testing timezone_transitions_get() : basic functionality ***\n";
13 //Set the default time zone 
14 date_default_timezone_set("Europe/London");
16 // Create a DateTimeZone object
17 $tz = timezone_open("Europe/London");
19 $tran = timezone_transitions_get($tz);
21 echo "\n-- Get all transitions --\n"; 
22 $tran = timezone_transitions_get($tz);
23 var_dump( gettype($tran) );
25 echo "\n-- Total number of transitions: " . count($tran). " --\n"; 
27 echo "\n-- Format a sample entry pfor Spring 1963 --\n";
28 var_dump( $tran[97] );  
31 ===DONE===
32 --EXPECT--
33 *** Testing timezone_transitions_get() : basic functionality ***
35 -- Get all transitions --
36 string(5) "array"
38 -- Total number of transitions: 243 --
40 -- Format a sample entry pfor Spring 1963 --
41 array(5) {
42   ["ts"]=>
43   int(-213228000)
44   ["time"]=>
45   string(24) "1963-03-31T02:00:00+0000"
46   ["offset"]=>
47   int(3600)
48   ["isdst"]=>
49   bool(true)
50   ["abbr"]=>
51   string(3) "BST"
53 ===DONE===