import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-array / array_diff_ukey_variation11.php
blob14a70426b4705a23613c3803ac75ab601d6166af
1 <?php
2 /* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
3 * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments. User supplied function is used for comparing the keys. This function is like array_udiff() but works on the keys instead of the values. The associativity is preserved.
4 * Source code: ext/standard/array.c
5 */
7 echo "*** Testing array_diff_ukey() : usage variation ***\n";
9 // Initialise function arguments not being substituted (if any)
10 $array1 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8);
11 $array2 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
12 $array3 = array(1, 2, 3, 4, 5);
14 // Define error handler
15 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
16 if (error_reporting() != 0) {
17 // report non-silenced errors
18 echo "Error: $err_no - $err_msg, $filename($linenum)\n";
21 set_error_handler('test_error_handler');
24 class classWithoutToString
28 $value = new classWithoutToString();
30 var_dump( array_diff_ukey($array1, $array2, $value) );
31 var_dump( array_diff_ukey($array1, $array2, $array3, $value) );
34 ===DONE===