1--TEST-- 2Test array_combine() function : usage variations - binary safe checking 3--FILE-- 4<?php 5/* Prototype : array array_combine(array $keys, array $values) 6 * Description: Creates an array by using the elements of the first parameter as keys 7 * and the elements of the second as the corresponding values 8 * Source code: ext/standard/array.c 9*/ 10 11/* 12* Testing the behavior of array_combine() by passing array with 13* binary values for $keys and $values argument. 14*/ 15 16echo "*** Testing array_combine() : binary safe checking ***\n"; 17 18// array with binary values 19$arr_binary = array(b"hello", b"world"); 20$arr_normal = array("hello", "world"); 21 22// array with binary value for $keys and $values argument 23var_dump( array_combine($arr_binary, $arr_binary) ); 24 25// array with binary value for $values argument 26var_dump( array_combine($arr_normal, $arr_binary) ); 27 28// array with binary value for $keys argument 29var_dump( array_combine($arr_binary, $arr_normal) ); 30 31echo "Done"; 32?> 33--EXPECT-- 34*** Testing array_combine() : binary safe checking *** 35array(2) { 36 ["hello"]=> 37 string(5) "hello" 38 ["world"]=> 39 string(5) "world" 40} 41array(2) { 42 ["hello"]=> 43 string(5) "hello" 44 ["world"]=> 45 string(5) "world" 46} 47array(2) { 48 ["hello"]=> 49 string(5) "hello" 50 ["world"]=> 51 string(5) "world" 52} 53Done 54