<?php class Point implements Serializable { public $y; public function __construct($y) { $this->y = $y; } public function serialize() { return serialize($this->y); } public function unserialize($data) { $this->y = unserialize($data); } } $d = new DateTime('2025/1/1 00:00:00'); $point = new Point($d); $ser = serialize($point); var_dump($d, $ser); var_dump(unserialize($ser));
You have javascript disabled. You will not be able to edit any code.