3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $myObject; public function __clone(): string { } }
Output for 8.0.0 - 8.0.29, 8.1.0 - 8.1.20, 8.2.0 - 8.2.7
Fatal error: Foo::__clone(): Return type must be void when declared in /in/Ub54p on line 7
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Clone method Foo::__clone() cannot declare a return type in /in/Ub54p on line 3
Process exited with code 255.
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33
Fatal error: Foo::__clone() cannot declare a return type in /in/Ub54p on line 3
Process exited with code 255.

preferences:
253.04 ms | 1387 KiB | 166 Q