SplObjectStorage::attach Adds an object in the storage &warn.deprecated.function-8-5-0; &reftitle.description; #[\Deprecated] public voidSplObjectStorage::attach objectobject mixedinfo&null; Adds an object inside the storage, and optionally associate it to some data. This method is an alias of SplObjectStorage::offsetSet. &reftitle.parameters; object The object to add. info The data to associate with the object. &reftitle.returnvalues; &return.void; &reftitle.examples; <function>SplObjectStorage::attach</function> example attach($o1); // similar to $s[$o1] = NULL; $s->attach($o2, "hello"); // similar to $s[$o2] = "hello"; var_dump($s[$o1]); var_dump($s[$o2]); ?> ]]> &example.outputs.similar; &reftitle.seealso; SplObjectStorage::detach SplObjectStorage::offsetSet