php8.5
Home/ Manual/ yaf / yaf_session/ Yaf_Session::next

Yaf_Session::next

PHP function Edit on GitHub ✎

(Yaf >=1.0.0)

Advance to next session entry

Description

Yaf_Session::next(): void

Moves the internal iterator to the next session entry.

Parameters Parameters

Return Values

No value is returned.

Examples

Yaf_Session::next example

php
<?php
$session = Yaf_Session::getInstance();
$session->start();

$session->set("user_id", 42);
$session->set("lang", "en");

$session->rewind();
echo $session->key(), PHP_EOL;

$session->next();
echo $session->key(), PHP_EOL;
?>

The above example will output something similar to:

output
user_id
lang

See Also

  • Yaf_Session::current
  • Yaf_Session::key
  • Yaf_Session::rewind
  • Yaf_Session::valid

Source: reference/yaf/yaf_session/next.xml · from the official PHP manual (php/doc-en)