SplObjectStorage::current
Returns the current storage entry
&reftitle.description;
public objectSplObjectStorage::current
Returns the current storage entry.
&reftitle.parameters;
&no.function.parameters;
&reftitle.returnvalues;
The object at the current iterator position.
&reftitle.changelog;
&Version;
&Description;
8.1.0
SplObjectStorage::current now throws an Error exception
if the current position is invalid. Previously, &false; was returned instead.
&reftitle.examples;
SplObjectStorage::current example
attach($o1, "d1");
$s->attach($o2, "d2");
$s->rewind();
while($s->valid()) {
$index = $s->key();
$object = $s->current(); // similar to current($s)
$data = $s->getInfo();
var_dump($object);
var_dump($data);
$s->next();
}
?>
]]>
&example.outputs.similar;
&reftitle.seealso;
SplObjectStorage::rewind
SplObjectStorage::key
SplObjectStorage::next
SplObjectStorage::valid
SplObjectStorage::getInfo