3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Connection { public function __sleep() { return 1; } } serialize(new Connection());
Output for 8.0.0 - 8.0.11, 8.1rc1 - rc2
Warning: serialize(): Connection::__sleep() should return an array only containing the names of instance-variables to serialize in /in/dH96A on line 11
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.30, 7.4.0 - 7.4.23
Notice: serialize(): __sleep should return an array only containing the names of instance-variables to serialize in /in/dH96A on line 11

preferences:
53.72 ms | 460 KiB | 5 Q