Yaf_Config_Simple::__isset
PHP Manual
PHP Manual»Yaf_Config_Simple»Yaf_Config_Simple::__isset

Yaf_Config_Simple::__isset

(Yaf >=1.0.0)

Yaf_Config_Simple::__isset — Check if a key exists

Опис

public function Yaf_Config_Simple::__isset(string $name): bool

Checks whether a configuration key exists. This method is invoked when isset() is used on a configuration object.

Параметри

name

The configuration key to check.

Значення, що повертаються

Returns true if the key exists, false otherwise.

Приклади

Приклад #1 Yaf_Config_Simple::__isset() example

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

var_dump(isset($config->application));
var_dump($config->__isset('application'));
var_dump(isset($config->cache));
?>

Поданий вище приклад виведе щось схоже на:

bool(true)
bool(true)
bool(false)

Прогляньте також

To Top