3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HasProp { public int $x; public function __sleep() { return ['x']; } } $x = new HasProp(); // string(28) "O:7:"HasProp":1:{s:1:"x";N;}" var_dump($s = serialize($x)); // Fatal error: Uncaught TypeError: Typed property HasProp::$x must be int, null used in ... unserialize($s);

preferences:
51.75 ms | 402 KiB | 5 Q