Dutch PHP Conference 2027

Yaf_Config_Simple::__isset

(Yaf >=1.0.0)

Yaf_Config_Simple::__issetCheck if a key exists

Beschreibung

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.

Parameter-Liste

name

The configuration key to check.

Rückgabewerte

Returns true if the key exists, false otherwise.

Beispiele

Beispiel #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));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

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

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top