Skip to content

Instantly share code, notes, and snippets.

@stevenseeley
Created October 14, 2019 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenseeley/864c1640e8ca99e4b30e17256b0ddcb9 to your computer and use it in GitHub Desktop.
Save stevenseeley/864c1640e8ca99e4b30e17256b0ddcb9 to your computer and use it in GitHub Desktop.
class hack implements Serializable{
public function serialize()
{
return json_encode(array(
$this->name,
$this->data
));
}
public function unserialize($data)
{
list($this->name, $this->data) = json_decode($data, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment