3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { // construct and destruct can't have return type public function __construct() {} public function __destruct() {} // below can have return type public function __invoke(): string { return ''; } public function __unset($a): void {} public function __wakeup(): void {} public function __clone(): void {} public function __toString(): string { return ''; } public function __isset($a): bool { return true; } public function __sleep(): array { return ''; } public static function __set_state($a): object { return ''; } }
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12

preferences:
47.49 ms | 406 KiB | 5 Q