SplObjectStorage::attach
Adds an object in the storage
&reftitle.description;
public voidSplObjectStorage::attach
objectobject
mixedinfo&null;
Adds an object inside the storage, and optionally associate it to some data.
&reftitle.parameters;
object
The object to add.
info
The data to associate with the object.
&reftitle.returnvalues;
&return.void;
&reftitle.examples;
SplObjectStorage::attach 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