2 /* Prototype : proto bool is_subclass_of(object object, string class_name)
3 * Description: Returns true if the object has this class as one of its parents
4 * Source code: Zend/zend_builtin_functions.c
7 // Note: basic use cases in Zend/tests/is_a.phpt
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');
18 echo "*** Testing is_subclass_of() : usage variations ***\n";
20 // Initialise function arguments not being substituted (if any)
21 $class_name = 'stdClass';
23 //get an unset variable
27 //array of values to iterate over
48 array('color' => 'red', 'item' => 'pen'),
75 // loop through each element of the array for object
77 foreach($values as $value) {
78 echo "\nArg value $value \n";
79 var_dump( is_subclass_of($value, $class_name) );