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('Serialize Ticket with Nesting on
'); echo($ticket->Serialize(true)); echo('

Deserialize Ticket with Nesting on (vardump)
<'); echo(var_dump(Ticket::Deserialize($ticket->Serialize(true), true))); echo('

Re-Serialize Deserialized Ticket with Nesting on
'); echo(Ticket::Deserialize($ticket->Serialize(true), true))->Serialize(true); echo('


End Time in microseconds: ' . microtime(true)); echo('



Start Time in microseconds: ' . microtime(true) . '


'); echo('Serialize Ticket with Nesting off
'); echo($ticket->Serialize(false)); echo('

Deserialize Ticket with Nesting off (vardump)
<'); echo(var_dump(Ticket::Deserialize($ticket->Serialize(false), false, $database))); echo('

Re-Serialize Deserialized Ticket with Nesting off
'); echo(Ticket::Deserialize($ticket->Serialize(false), false, $database))->Serialize(false); echo('


End Time in microseconds: ' . microtime(true)); ?>