2 /* Prototype : string timezone_name_from_abbr ( string $abbr [, int $gmtOffset= -1 [, int $isdst= -1 ]] )
3 * Description: Returns the timezone name from abbrevation
4 * Source code: ext/date/php_date.c
8 echo "*** Testing timezone_name_from_abbr() : usage variation - unexpected values to second argument \$gmtOffset***\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
47 'int -12345' => -12345,
51 'float -10.5' => -10.5,
55 'empty array' => array(),
56 'int indexed array' => $index_array,
57 'associative array' => $assoc_array,
58 'nested arrays' => array('foo', $index_array, $assoc_array),
61 'uppercase NULL' => NULL,
62 'lowercase null' => null,
65 'lowercase true' => true,
66 'lowercase false' =>false,
67 'uppercase TRUE' =>TRUE,
68 'uppercase FALSE' =>FALSE,
71 'empty string DQ' => "",
72 'empty string SQ' => '',
75 'string DQ' => "string",
76 'string SQ' => 'string',
77 'mixed case string' => "sTrInG",
78 'heredoc' => $heredoc,
81 'instance of classWithToString' => new classWithToString(),
82 'instance of classWithoutToString' => new classWithoutToString(),
85 'undefined var' => @$undefined_var,
88 'unset var' => @$unset_var,
91 'resource' => $file_handle
97 foreach($inputs as $variation =>$gmtOffset) {
98 echo "\n-- $variation --\n";
99 var_dump( timezone_name_from_abbr($abbr, $gmtOffset, $isdst) );
102 // closing the resource
103 fclose( $file_handle );