- var_dump: documentation ( source)
<?php
$storage = new SplObjectStorage;
$foo = (object)['foo' => 'bar'];
$storage->attach($foo, ['room' => 'bar']);
foreach ($storage as $value) {
$obj = $storage->current(); // current object
$assoc_key = $storage->getInfo(); // return, if exists, associated with cur. obj. data; else NULL
var_dump($obj);
var_dump($assoc_dump);
}