3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class SleepyHead { protected $name = "Dozy"; public function __sleep() { $this->name = "Asleep"; } public function __wakeUp() { $this->name = "Rested"; } } $obj = unserialize(serialize(new SleepyHead())); var_dump($obj);
based on OV1kA
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.21.3, 7.0.0 - 7.3.0beta1
Notice: serialize(): __sleep should return an array only containing the names of instance-variables to serialize in /in/H96m9 on line 14 NULL
Output for hhvm-3.22.0
Notice: serialize(): __sleep should return an array only containing the names of instance-variables to serialize in /in/H96m9 on line -1 NULL