2 Test is_a() function : usage variations - wrong type for arg 1
4 error_reporting=E_ALL | E_STRICT | E_DEPRECATED
7 /* Prototype : proto bool is_a(object object, string class_name)
8 * Description: Returns true if the object is of this class or has this class as one of its parents
9 * Source code: Zend/zend_builtin_functions.c
12 // Note: basic use cases in Zend/tests/is_a.phpt
13 echo "*** Testing is_a() : usage variations ***\n";
15 // Initialise function arguments not being substituted (if any)
16 $class_name = 'stdClass';
18 //get an unset variable
22 //array of values to iterate over
43 array('color' => 'red', 'item' => 'pen'),
70 // loop through each element of the array for object
72 foreach($values as $value) {
73 echo @"\nArg value $value \n";
74 var_dump( is_a($value, $class_name) );
80 *** Testing is_a() : usage variations ***
82 Notice: Undefined variable: undefined_var in %s on line 59
84 Notice: Undefined variable: unset_var in %s on line 62
104 Arg value 101234567000
107 Arg value 1.07654321E-9