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
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
26 //array of values to iterate over
47 array('color' => 'red', 'item' => 'pen'),
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) );