init();
$service = new Service();
$service->id = "minetest";
$service->token = "45678-hsjsndjs-272892-shgdzusjd-6788";
$user = new User();
$user->id = "bananafish";
$user->serial = '0C:87:64:78';
$user->cert = "Yee Haw";
$grant = new Grant();
$grant->id = uniqid();
$grant->service = $service;
$ticket = new Ticket();
$ticket->id = uniqid();
$ticket->start = 1471111;
$ticket->end = 1474567;
$ticket->user = $user;
$ticket->grant = $grant;
$database->save($service);
$database->save($user);
$database->save($grant);
$database->save($ticket);
echo('Start Time in microseconds: ' . microtime(true) . '
');
echo($ticket->Serialize(true));
echo('
<');
echo(var_dump(Ticket::Deserialize($ticket->Serialize(true), true)));
echo('
');
echo(Ticket::Deserialize($ticket->Serialize(true), true))->Serialize(true);
echo('
');
echo($ticket->Serialize(false));
echo('
<');
echo(var_dump(Ticket::Deserialize($ticket->Serialize(false), false, $database)));
echo('
');
echo(Ticket::Deserialize($ticket->Serialize(false), false, $database))->Serialize(false);
echo('