- session_write_close: documentation ( source)
- var_dump: documentation ( source)
- register_shutdown_function: documentation ( source)
- session_start: documentation ( source)
<?php
class Test
{
public function __construct()
{
session_start();
$_SESSION['construct'] = true;
var_dump($_SESSION);
echo "constructor<br/>";
register_shutdown_function(function() {
$_SESSION['shutdown'] = true;
unset($_SESSION['construct']);
echo "shutdown<br/>";
});
}
public function __destruct()
{
session_write_close();
echo "destructor<br/>";
}
}
$test = new Test;