SplObjectStorage::offsetGet() can become EXTREMELY slow depending on the associated data (PHP 5.6).
<?php
$object = new stdClass;
$test = new SplObjectStorage;
$test->attach($object, str_repeat("\0", 1024*1024));
$start = microtime(true);
for ($i = 0; $i < 1000000; $i++) {
$test->offsetGet($object);
}
var_dump(microtime(true) - $start); $object = new stdClass;
$test = [];
$test[spl_object_hash($object)] = str_repeat("\0", 1024*1024);
$start = microtime(true);
for ($i = 0; $i < 1000000; $i++) {
$temp = $test[spl_object_hash($object)];
}
var_dump(microtime(true) - $start);