(Yaf >=1.0.0)
Yaf_Config_Simple::offsetExists — 检查键是否存在(ArrayAccess)
检查配置键是否存在。此方法是 Yaf_Config_Simple::__isset() 的别名,当对配置对象以数组方式使用 isset() 时会被调用。
name要检查的配置键。
示例 #1 Yaf_Config_Simple::offsetExists() 示例
<?php
$config = new Yaf_Config_Simple([
'application' => ['name' => 'MyApp'],
'database' => ['host' => 'localhost'],
]);
var_dump(isset($config['database']));
var_dump($config->offsetExists('database'));
var_dump(isset($config['cache']));
?>以上示例的输出类似于:
bool(true) bool(true) bool(false)