1--TEST-- 2Test array_intersect_uassoc() function : usage variation - arrays containing referenced variables 3--FILE-- 4<?php 5echo "*** Testing array_intersect_uassoc() : usage variation ***\n"; 6 7//Initialize variables 8$ref_var = 'a'; 9$array1 = array('a', $ref_var); 10$array2 = array('a' => 1, &$ref_var); 11 12echo "\n-- Testing array_intersect_uassoc() function with referenced variable \$ref_var has value '$ref_var' --\n"; 13var_dump( array_intersect_uassoc($array1, $array2, "strcasecmp") ); 14 15// re-assign reference variable to different value 16$ref_var = 10; 17echo "\n-- Testing array_intersect_uassoc() function with referenced variable \$ref_var value changed to $ref_var --\n"; 18var_dump( array_intersect_uassoc($array1, $array2, "strcasecmp") ); 19 20//When array are referenced 21$array2 = &$array1; 22echo "\n-- Testing array_intersect_uassoc() function when \$array2 is referencd to \$array1 --\n"; 23var_dump( array_intersect_uassoc($array1, $array2, "strcasecmp") ); 24?> 25--EXPECT-- 26*** Testing array_intersect_uassoc() : usage variation *** 27 28-- Testing array_intersect_uassoc() function with referenced variable $ref_var has value 'a' -- 29array(1) { 30 [0]=> 31 string(1) "a" 32} 33 34-- Testing array_intersect_uassoc() function with referenced variable $ref_var value changed to 10 -- 35array(0) { 36} 37 38-- Testing array_intersect_uassoc() function when $array2 is referencd to $array1 -- 39array(2) { 40 [0]=> 41 string(1) "a" 42 [1]=> 43 string(1) "a" 44} 45