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);
Output for 7.0.0 - 7.0.24, 7.1.0 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
string(51) "O:3:"Foo":2:{s:8:"savethis";i:1;s:7:"andthis";i:2;}" bool(true)

preferences:
24.39 ms | 819 KiB | 4 Q