I was using a binary with the new timelib. Undo the datetime tests
[hiphop-php.git] / hphp / test / zend / bad / ext-date / gmdate_variation1.php
blob8068d5f854fcbed55c3d7310e0896ab89084d8ab
1 <?php
2 /* Prototype : string gmdate(string format [, long timestamp])
3 * Description: Format a GMT date/time
4 * Source code: ext/date/php_date.c
5 * Alias to functions:
6 */
8 echo "*** Testing gmdate() : usage variation ***\n";
10 // Initialise all required variables
11 date_default_timezone_set('UTC');
12 $timestamp = mktime(8, 8, 8, 8, 8, 2008);
14 //get an unset variable
15 $unset_var = 10;
16 unset ($unset_var);
18 // define some classes
19 class classWithToString
21 public function __toString() {
22 return "Class A object";
26 class classWithoutToString
30 // heredoc string
31 $heredoc = <<<EOT
32 hello world
33 EOT;
35 // add arrays
36 $index_array = array (1, 2, 3);
37 $assoc_array = array ('one' => 1, 'two' => 2);
39 //array of values to iterate over
40 $inputs = array(
42 // int data
43 'int 0' => 0,
44 'int 1' => 1,
45 'int 12345' => 12345,
46 'int -12345' => -12345,
48 // float data
49 'float 10.5' => 10.5,
50 'float -10.5' => -10.5,
51 'float 12.3456789000e10' => 12.3456789000e10,
52 'float -12.3456789000e10' => -12.3456789000e10,
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 // object data
76 'instance of classWithToString' => new classWithToString(),
77 'instance of classWithoutToString' => new classWithoutToString(),
79 // undefined data
80 'undefined var' => @$undefined_var,
82 // unset data
83 'unset var' => @$unset_var,
86 // loop through each element of the array for format
88 foreach($inputs as $key =>$value) {
89 echo "\n--$key--\n";
90 var_dump( gmdate($value, $timestamp) );
91 var_dump( gmdate($value) );
95 ===DONE===