import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-array / array_intersect_uassoc_variation11.php
blob177ada82c7c324c22ef7524ed4f67f4c11f4c70f
1 <?php
2 /* Prototype : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
3 * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
4 * Source code: ext/standard/array.c
5 */
7 echo "*** Testing array_intersect_uassoc() : usage variation ***\n";
9 // Initialise function arguments
10 $array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
11 $array2 = array("a" => "green", "yellow", "red");
12 $array3 = array("a"=>"green", "brown");
13 // Define error handler
14 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
15 if (error_reporting() != 0) {
16 // report non-silenced errors
17 echo "Error: $err_no - $err_msg, $filename($linenum)\n";
20 set_error_handler('test_error_handler');
23 class classWithoutToString
27 $value = new classWithoutToString();
29 var_dump( array_intersect_uassoc($array1, $array2, $value) );
30 var_dump( array_intersect_uassoc($array1, $array2, $array3, $value) );
32 ===DONE===