Yaf_Session::count

(Yaf >=1.0.0)

Yaf_Session::countCount session entries

Description

public function Yaf_Session::count(): int

Returns the number of entries in the session.

Parameters

This function has no parameters.

Return Values

The number of session entries as an integer.

Examples

Example #1 Yaf_Session::count() example

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

$session->set("user_id", 42);
$session->set("cart_items", 3);

var_dump(count($session));
?>

The above example will output something similar to:

int(2)

See Also

add a note

User Contributed Notes

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