import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-class_object / get_class_vars_variation1.php
blobc13064673e1470a10495e99808d97f1e6c5a7782
1 <?php
2 /* Prototype : array get_class_vars(string class_name)
3 * Description: Returns an array of default properties of the class.
4 * Source code: Zend/zend_builtin_functions.c
5 * Alias to functions:
6 */
8 echo "*** Testing get_class_vars() : usage variation ***\n";
10 //get an unset variable
11 $unset_var = 10;
12 unset ($unset_var);
14 // define some classes
15 class classWithToString
17 public function __toString() {
18 return "Class A object";
22 class classWithoutToString
26 // heredoc string
27 $heredoc = <<<EOT
28 hello world
29 EOT;
31 // add arrays
32 $index_array = array (1, 2, 3);
33 $assoc_array = array ('one' => 1, 'two' => 2);
35 //array of values to iterate over
36 $inputs = array(
38 // int data
39 'int 0' => 0,
40 'int 1' => 1,
41 'int 12345' => 12345,
42 'int -12345' => -2345,
44 // float data
45 'float 10.5' => 10.5,
46 'float -10.5' => -10.5,
47 'float 12.3456789000e10' => 12.3456789000e10,
48 'float -12.3456789000e10' => -12.3456789000e10,
49 'float .5' => .5,
51 // array data
52 'empty array' => array(),
53 'int indexed array' => $index_array,
54 'associative array' => $assoc_array,
55 'nested arrays' => array('foo', $index_array, $assoc_array),
57 // null data
58 'uppercase NULL' => NULL,
59 'lowercase null' => null,
61 // boolean data
62 'lowercase true' => true,
63 'lowercase false' =>false,
64 'uppercase TRUE' =>TRUE,
65 'uppercase FALSE' =>FALSE,
67 // empty data
68 'empty string DQ' => "",
69 'empty string SQ' => '',
71 // object data
72 'instance of classWithToString' => new classWithToString(),
73 'instance of classWithoutToString' => new classWithoutToString(),
75 // undefined data
76 'undefined var' => @$undefined_var,
78 // unset data
79 'unset var' => @$unset_var,
82 // loop through each element of the array for method_name
84 foreach($inputs as $key =>$value) {
85 echo "\n--$key--\n";
86 var_dump( get_class_vars($value) );
90 ===DONE===