- debug_zval_dump: documentation ( source)
<pre><?php
$var1 = 'ccc';
$var2 = 'ccc';
echo "separate variables\n";
debug_zval_dump($var1);
echo "Copying variable just adds references to the same value\n";
$copy = $var1;
debug_zval_dump($var1, $copy);
echo "Using a reference adds references to the same value \n";
$reference =& $var2;
debug_zval_dump($var2, $reference);
echo "Using a copy and a reference of the same value actually creates a clone \n";
$reference2 =& $var1;
debug_zval_dump($var1, $copy, $reference2);