2 /* Prototype : array timezone_transitions_get ( DateTimeZone $object, [ int $timestamp_begin [, int $timestamp_end ]] )
3 * Description: Returns all transitions for the timezone
4 * Source code: ext/date/php_date.c
5 * Alias to functions: DateTimeZone::getTransitions()
8 echo "*** Testing timezone_transitions_get() : usage variation - unexpected values to first argument \$timestamp_end ***\n";
10 //Set the default time zone
11 date_default_timezone_set("Europe/London");
13 //get an unset variable
17 // define some classes
18 class classWithToString
20 public function __toString() {
21 return "Class A object";
25 class classWithoutToString
35 $index_array = array (1, 2, 3);
36 $assoc_array = array ('one' => 1, 'two' => 2);
39 $file_handle = fopen(__FILE__
, 'r');
41 //array of values to iterate over
48 'int -12345' => -12345,
52 'float -10.5' => -10.5,
56 'empty array' => array(),
57 'int indexed array' => $index_array,
58 'associative array' => $assoc_array,
59 'nested arrays' => array('foo', $index_array, $assoc_array),
62 'uppercase NULL' => NULL,
63 'lowercase null' => null,
66 'lowercase true' => true,
67 'lowercase false' =>false,
68 'uppercase TRUE' =>TRUE,
69 'uppercase FALSE' =>FALSE,
72 'empty string DQ' => "",
73 'empty string SQ' => '',
76 'string DQ' => "string",
77 'string SQ' => 'string',
78 'mixed case string' => "sTrInG",
79 'heredoc' => $heredoc,
82 'instance of classWithToString' => new classWithToString(),
83 'instance of classWithoutToString' => new classWithoutToString(),
86 'undefined var' => @$undefined_var,
89 'unset var' => @$unset_var,
92 'resource' => $file_handle
95 $tz = timezone_open("Europe/London");
96 $timestamp_begin = mktime(0, 0, 0, 1, 1, 1975);
98 foreach($inputs as $variation =>$timestamp_end) {
99 echo "\n-- $variation --\n";
100 $tran = timezone_transitions_get($tz, $timestamp_begin, $timestamp_end);
101 var_dump( gettype($tran) );
102 var_dump( count($tran) );
105 // closing the resource
106 fclose( $file_handle );