Yaf_Config_Simple::valid
Check if current position is valid
Description
public bool Yaf_Config_Simple::valid()
Checks whether the current iterator position is valid.
Parameters
This function has no parameters.
Return Values
Returns true if the current position is valid, false otherwise.
Examples
Example #1 Yaf_Config_Simple::valid example
<?php
$config = new Yaf_Config_Simple([
'application' => ['name' => 'MyApp'],
'database' => ['host' => 'localhost'],
]);
$config->rewind();
var_dump($config->valid());
$config->next();
var_dump($config->valid());
$config->next(); // past the last entry
var_dump($config->valid());
?>
The above example will output
something similar to:
bool(true)
bool(true)
bool(false)
See Also
- Yaf_Config_Simple::current
- Yaf_Config_Simple::key
- Yaf_Config_Simple::next
- Yaf_Config_Simple::rewind