Revert "make hphpc able to use ini files"
[hiphop-php.git] / hphp / test / zend / bad / ext / standard / tests / class_object / class_exists_variation_002.php
blob88c119d2ada1f372e8c5ee2c70b7287fb27af432
1 <?php
2 /* Prototype : proto bool class_exists(string classname [, bool autoload])
3 * Description: Checks if the class exists
4 * Source code: Zend/zend_builtin_functions.c
5 * Alias to functions:
6 */
8 function __autoload($className) {
9 echo "In __autoload($className)\n";
12 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
13 echo "Error: $err_no - $err_msg, $filename($linenum)\n";
15 set_error_handler('test_error_handler');
17 echo "*** Testing class_exists() : usage variations ***\n";
19 // Initialise function arguments not being substituted (if any)
20 $classname = 'string_val';
22 //get an unset variable
23 $unset_var = 10;
24 unset ($unset_var);
26 //array of values to iterate over
27 $values = array(
29 // int data
32 12345,
33 -2345,
35 // float data
36 10.5,
37 -10.5,
38 10.1234567e10,
39 10.7654321E-10,
40 .5,
42 // array data
43 array(),
44 array(0),
45 array(1),
46 array(1, 2),
47 array('color' => 'red', 'item' => 'pen'),
49 // null data
50 NULL,
51 null,
53 // boolean data
54 true,
55 false,
56 TRUE,
57 FALSE,
59 // empty data
60 "",
61 '',
63 // string data
64 "string",
65 'string',
67 // object data
68 new stdclass(),
70 // undefined data
71 $undefined_var,
73 // unset data
74 $unset_var,
77 // loop through each element of the array for autoload
79 foreach($values as $value) {
80 echo "\nArg value $value \n";
81 var_dump( class_exists($classname, $value) );
84 echo "Done";