--TEST-- SplObjectStorage::getHash() implementation --FILE-- offsetGet($o1)); var_dump($instance[$o1]); $instance[$o2] = $o2; var_dump($instance[$o1] === $instance[$o2]); } catch(Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- Instance as SplObjectStorage string(3) "foo" string(3) "foo" bool(false) Instance as MySplObjectStorage1 TypeError: MySplObjectStorage1::getHash(): Return value must be of type string, int returned Instance as MySplObjectStorage2 Exception: foo Instance as MySplObjectStorage3 string(3) "foo" string(3) "foo" bool(true)