1--TEST-- 2Test array_diff_assoc() function : usage variations - binary safe check 3--FILE-- 4<?php 5/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...]) 6 * Description: Returns the entries of arr1 that have values which are not 7 * present in any of the others arguments but do additional checks whether 8 * the keys are equal 9 * Source code: ext/standard/array.c 10 */ 11 12/* 13 * Test how array_diff_assoc() compares binary data 14 */ 15 16echo "*** Testing array_diff_assoc() : usage variations ***\n"; 17 18$array1 = array( b"1", 19 b"hello", 20 "world", 21 "str1" => "hello", 22 "str2" => "world"); 23 24$array2 = array( b"1" => 'hello', 25 b"world", 26 "hello", 27 'test'); 28 29var_dump(array_diff_assoc($array1, $array2)); 30var_dump(array_diff_assoc($array2, $array1)); 31 32echo "Done"; 33?> 34--EXPECT-- 35*** Testing array_diff_assoc() : usage variations *** 36array(3) { 37 [0]=> 38 string(1) "1" 39 ["str1"]=> 40 string(5) "hello" 41 ["str2"]=> 42 string(5) "world" 43} 44array(2) { 45 [3]=> 46 string(5) "hello" 47 [4]=> 48 string(4) "test" 49} 50Done 51