PHP 8.6.0 Beta 3 is available for testing

Yaf_Session::__construct

(Yaf >=1.0.0)

Yaf_Session::__constructConstructor of Yaf_Session

Descrizione

privatefunction Yaf_Session::__construct()

The constructor is private: Yaf_Session implements the singleton pattern and cannot be instantiated directly. Use Yaf_Session::getInstance() to obtain the session instance.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

No value is returned.

Esempi

Example #1 Yaf_Session::__construct() example

<?php
// The constructor is private, so Yaf_Session cannot be
// instantiated with "new". Access it through the singleton:
$session = Yaf_Session::getInstance();
$session->start();

$session->set("user_id", 42);
echo $session->get("user_id");
?>

Vedere anche:

add a note

User Contributed Notes

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