Can anyone explain me, why in the session in this case we get the object with 2 properties?
set_error_handler('my_error_handler');
session_start();
$obj = new myclass();
$_SESSION['obj'] = $obj;
$a->b();
class myclass
{
private $a = 1;
private $b = 2;
public function __sleep()
{
return array('a');
}
}
function my_error_handler($code, $error, $file = NULL, $line = NULL)
{
throw new ErrorException($error, $code, 0, $file, $line);
}
UPD: here i expect to get:
1. fatal error (passed)
2. object in session (in session file) with 1 property (failed)