SplObjectStorage::key
Devuelve el índice en el que se encuentra el iterador actualmente
&reftitle.description;
public intSplObjectStorage::key
Devuelve el índice en el que se encuentra el iterador actualmente.
&reftitle.parameters;
&no.function.parameters;
&reftitle.returnvalues;
El índice correspondiente a la posición de el iterador.
&reftitle.examples;
Ejemplo de SplObjectStorage::key
attach($o1, "d1");
$s->attach($o2, "d2");
$s->rewind();
while($s->valid()) {
$index = $s->key();
$object = $s->current(); // similar a current($s)
var_dump($index);
var_dump($object);
$s->next();
}
?>
]]>
&example.outputs.similar;
&reftitle.seealso;
SplObjectStorage::rewind
SplObjectStorage::current
SplObjectStorage::next
SplObjectStorage::valid