hi, i'm running into some weird behavior with php references. i distilled it down to some test code below:
<?php $array = array( 'name' => 'dean' ); $var1['arrayref'] = & $array; $var2 = $var1; echo "var1:\n"; print_r( $var1 ); echo "var2:\n"; print_r( $var2 ); $var1['arrayref'] = NULL; echo "var1:\n"; print_r( $var1 ); echo "var2:\n"; print_r( $var2 ); ?> it seems that setting a hash key to a reference to something, and then repointing that key to NULL, apparently sets the original 'something' to NULL instead of just 'repointing' the hash key! am i missing something obvious here, or is this behavior not what you'd normally expect? i wrote similar code in perl, and it behaved as i expected: the second hash still pointed to the original target (i am almost certain c/c++ and java also behave this way). so what is going on with php? does anyone know how to get it to do what i want it to do -- i.e., merely unset the key mapping of one of the hashes, leaving the other hash still pointing at the target? thansk for any insight you might be able to give! xomina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php