1--TEST-- 2Test array_intersect_assoc() function : usage variations - binary safe checking 3--FILE-- 4<?php 5/* 6* Testing the behavior of array_intersect_assoc() by passing array with 7* binary values for $arr1 and $arr2 argument. 8*/ 9 10echo "*** Testing array_intersect_assoc() : binary safe checking ***\n"; 11 12// array with binary values 13$arr_binary = array(b"hello", b"world"); 14// simple array 15$arr_normal = array("hello", "world"); 16 17// array with binary value for $arr1 argument 18var_dump( array_intersect_assoc($arr_binary, $arr_normal) ); 19 20// array with binary value for $arr2 argument 21var_dump( array_intersect_assoc($arr_normal, $arr_binary) ); 22 23// array with binary value for both $arr1 and $arr2 argument 24var_dump( array_intersect_assoc($arr_binary, $arr_binary) ); 25 26echo "Done"; 27?> 28--EXPECT-- 29*** Testing array_intersect_assoc() : binary safe checking *** 30array(2) { 31 [0]=> 32 string(5) "hello" 33 [1]=> 34 string(5) "world" 35} 36array(2) { 37 [0]=> 38 string(5) "hello" 39 [1]=> 40 string(5) "world" 41} 42array(2) { 43 [0]=> 44 string(5) "hello" 45 [1]=> 46 string(5) "world" 47} 48Done 49