- var_dump: documentation ( source)
- implode: documentation ( source)
<?php
$a = array(3,4);
$b =& $a;
$c =& $a;
var_dump( is_same_ref( $a, $b ));
$a[] = 5;
$b[] = 6;
var_dump( implode( $a ), implode( $b ), implode( $c ));
function is_same_ref( & $a, & $b ){
// Save original values
$ori_a = $a;
$ori_b = $b;
// Give them different values
$a = 1;
$b = 2;
// Compare them, if they're equal, they are references to each other
$eq = $a === $b;
// Restore original values
$a = $ori_a;
$b = $ori_b;
return $eq;
}