- var_dump: documentation ( source)
- unserialize: documentation ( source)
- serialize: documentation ( source)
- spl_object_hash: documentation ( source)
<?php
function printForTest($a, $b) {
var_dump($a);
var_dump($b);
var_dump (spl_object_hash($a) === spl_object_hash($b) );
print "\n";
}
$a = new stdClass;
$b = $a;
$a->foo = "bar";
list ($cachedA, $cachedB) = unserialize(serialize(array($a, $b)));
$cachedA->hello = "world";
printForTest($cachedA, $cachedB);
unset($cachedA, $cachedB);
$cachedA = unserialize(serialize($a));
$cachedB = unserialize(serialize($b));
$cachedA->hello = "world";
printForTest($cachedA, $cachedB);