Lines Matching refs:in_array
2 Test in_array() function : usage variations - haystack as sub-array/object
6 * Prototype : bool in_array ( mixed $needle, array $haystack [, bool $strict] )
12 /* Test in_array() with haystack as sub-array and object */
14 /* checking for sub-arrays with in_array() */
15 echo "*** Testing sub-arrays with in_array() ***\n";
23 var_dump( in_array("four", $sub_array) );
25 var_dump( in_array(3, $sub_array[1]) );
26 var_dump( in_array(array('','i'), $sub_array) );
28 /* checking for objects in in_array() */
29 echo "\n*** Testing objects with in_array() ***\n";
39 var_dump( in_array("array_var", $in_array_obj) );
41 var_dump( in_array("foo", $in_array_obj) );
43 var_dump( in_array("one", $in_array_obj->array_var) );
48 *** Testing sub-arrays with in_array() ***
53 *** Testing objects with in_array() ***
55 Warning: in_array() expects parameter 2 to be array, object given in %s on line %d
58 Warning: in_array() expects parameter 2 to be array, object given in %s on line %d