- var_export: documentation ( source)
<?php
$spl = new SplObjectStorage ();
$keyForA = (object) ['key' => 'A'];
$keyForB = (object) ['key' => 'B'];
$spl[$keyForA] = 'value a';
$spl[$keyForB] = 'value b';
foreach ($spl as $i => $key) {
$value = $spl[$key];
print "Index: $i\n";
print "Key: " . var_export($key, TRUE) . "\n";;
print "Value: " . var_export($value, TRUE) . "\n";;
print "\n";
}
?>