php8.5
Home/ Manual/ yaf / yaf_config_simple/ Yaf_Config_Simple::next

Yaf_Config_Simple::next

PHP function Edit on GitHub ✎

(Yaf >=1.0.0)

Advance to next entry

Description

Yaf_Config_Simple::next(): void

Moves the internal iterator to the next configuration entry.

Parameters Parameters

Return Values

No value is returned.

Examples

Yaf_Config_Simple::next example

php
<?php
$config = new Yaf_Config_Simple([
    'application' => ['name' => 'MyApp'],
    'database'    => ['host' => 'localhost'],
]);

$config->rewind();
echo $config->key(), "\n";

$config->next();
echo $config->key(), "\n";

$config->next(); // past the last entry
var_dump($config->valid());
?>

The above example will output something similar to:

output
application
database
bool(false)

See Also

  • Yaf_Config_Simple::current
  • Yaf_Config_Simple::key
  • Yaf_Config_Simple::rewind
  • Yaf_Config_Simple::valid

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