Yaf_Session::__isset
PHP Manual
PHP Manual»Yaf_Session»Yaf_Session::__isset

Yaf_Session::__isset

(Yaf >=1.0.0)

Yaf_Session::__isset — Check if a session key exists

Beschreibung

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

Checks whether a session key exists. This method is an alias of Yaf_Session::has() and is called when isset() is used on a session object.

Parameter-Liste

name

The session key to check.

Rückgabewerte

Returns true if the key exists, false otherwise.

Beispiele

Beispiel #1 Yaf_Session::__isset() example

<?php
$session = Yaf_Session::getInstance();
$session->start();

$session->user_id = 42;

var_dump(isset($session->user_id));
var_dump(isset($session->user_name));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(true)
bool(false)

Siehe auch

To Top