diff --git a/src/Profiler/Profile.php b/src/Profiler/Profile.php index f33963b31..49f8917b7 100644 --- a/src/Profiler/Profile.php +++ b/src/Profiler/Profile.php @@ -158,14 +158,24 @@ class Profile implements \IteratorAggregate, \Serializable return new \ArrayIterator($this->profiles); } + public function __serialize() + { + return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]; + } + public function serialize() { - return serialize([$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]); + return serialize($this->__serialize()); + } + + public function __unserialize(array $data) + { + list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data; } public function unserialize($data) { - list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = unserialize($data); + $this->__unserialize(unserialize($data)); } }