import random crap zend files
[hiphop-php.git] / hphp / test / zend / bad / ext-date / timezone_transitions_get_variation2.php
blobb33f41d637605776ec797744e4c5e7de6b07d4d4
1 <?php
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()
6 */
8 echo "*** Testing timezone_transitions_get() : usage variation - unexpected values to first argument \$timestamp_begin ***\n";
10 //Set the default time zone
11 date_default_timezone_set("Europe/London");
13 //get an unset variable
14 $unset_var = 10;
15 unset ($unset_var);
17 // define some classes
18 class classWithToString
20 public function __toString() {
21 return "Class A object";
25 class classWithoutToString
29 // heredoc string
30 $heredoc = <<<EOT
31 hello world
32 EOT;
34 // add arrays
35 $index_array = array (1, 2, 3);
36 $assoc_array = array ('one' => 1, 'two' => 2);
38 // resource
39 $file_handle = fopen(__FILE__, 'r');
41 //array of values to iterate over
42 $inputs = array(
44 // int data
45 'int 0' => 0,
46 'int 1' => 1,
47 'int 12345' => 12345,
48 'int -12345' => -12345,
50 // float data
51 'float 10.5' => 10.5,
52 'float -10.5' => -10.5,
53 'float .5' => .5,
55 // array data
56 'empty array' => array(),
57 'int indexed array' => $index_array,
58 'associative array' => $assoc_array,
59 'nested arrays' => array('foo', $index_array, $assoc_array),
61 // null data
62 'uppercase NULL' => NULL,
63 'lowercase null' => null,
65 // boolean data
66 'lowercase true' => true,
67 'lowercase false' =>false,
68 'uppercase TRUE' =>TRUE,
69 'uppercase FALSE' =>FALSE,
71 // empty data
72 'empty string DQ' => "",
73 'empty string SQ' => '',
75 // string data
76 'string DQ' => "string",
77 'string SQ' => 'string',
78 'mixed case string' => "sTrInG",
79 'heredoc' => $heredoc,
81 // object data
82 'instance of classWithToString' => new classWithToString(),
83 'instance of classWithoutToString' => new classWithoutToString(),
85 // undefined data
86 'undefined var' => @$undefined_var,
88 // unset data
89 'unset var' => @$unset_var,
91 // resource
92 'resource' => $file_handle
95 $tz = timezone_open("Europe/London");
96 $timestamp_end = mktime(0, 0, 0, 1, 1, 1975);
98 foreach($inputs as $variation =>$timestamp_begin) {
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 );
109 ===DONE===