make test runner work in open source repo
[hiphop-php.git] / hphp / test / zend / bad / ext-date / mktime_variation2.php
bloba2ceefbb4f11bb2cc0c05046a1969f32a36caeb0
1 <?php
2 /* Prototype : int mktime ([ int $hour= date("H") [, int $minute= date("i") [, int $second= date("s") [, int $month= date("n") [, int $day= date("j") [, int $year= date("Y") [, int $is_dst= -1 ]]]]]]] )
3 * Description: Get Unix timestamp for a date
4 * Source code: ext/date/php_date.c
5 * Alias to functions:
6 */
8 echo "*** Testing mktime() : usage variation - unexpected values to second argument \$minute***\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 12345' => 12345,
47 'int -12345' => -12345,
49 // float data
50 'float 10.5' => 10.5,
51 'float -10.5' => -10.5,
52 'float .5' => .5,
54 // array data
55 'empty array' => array(),
56 'int indexed array' => $index_array,
57 'associative array' => $assoc_array,
58 'nested arrays' => array('foo', $index_array, $assoc_array),
60 // null data
61 'uppercase NULL' => NULL,
62 'lowercase null' => null,
64 // boolean data
65 'lowercase true' => true,
66 'lowercase false' =>false,
67 'uppercase TRUE' =>TRUE,
68 'uppercase FALSE' =>FALSE,
70 // empty data
71 'empty string DQ' => "",
72 'empty string SQ' => '',
74 // string data
75 'string DQ' => "string",
76 'string SQ' => 'string',
77 'mixed case string' => "sTrInG",
78 'heredoc' => $heredoc,
80 // object data
81 'instance of classWithToString' => new classWithToString(),
82 'instance of classWithoutToString' => new classWithoutToString(),
84 // undefined data
85 'undefined var' => @$undefined_var,
87 // unset data
88 'unset var' => @$unset_var,
90 // resource
91 'resource' => $file_handle
94 $hour = 10;
96 foreach($inputs as $variation =>$minute) {
97 echo "\n-- $variation --\n";
98 var_dump( mktime($hour, $minute) );
101 // closing the resource
102 fclose( $file_handle );
105 ===DONE===