3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements \Serializable { public function serialize(): string { return ''; } public function unserialize(string $serialized): void { } }
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Deprecated: Foo implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/b3HaW on line 3
Output for 8.0.0 - 8.0.30
Output for 7.4.0 - 7.4.33
Fatal error: Declaration of Foo::unserialize(string $serialized): void must be compatible with Serializable::unserialize($serialized) in /in/b3HaW on line 10
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Fatal error: Declaration of Foo::unserialize(string $serialized): void must be compatible with Serializable::unserialize($serialized) in /in/b3HaW on line 3
Process exited with code 255.

preferences:
171.5 ms | 410 KiB | 5 Q