3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $savethis; public $andthis; public $notthis; public function __construct($a, $b) { $this->savethis = $a; $this->andthis = $b; $this->notthis = microtime(true); } public function __sleep() { return ['savethis', 'andthis']; } public function __wakeup() { $this->notthis = microtime(true); } } $f = new Foo(1, 2); var_dump($g = serialize($f), unserialize($g)->notthis != $f->notthis);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
152.27 ms | 1447 KiB | 14 Q