3v4l.org

run code in 500+ 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.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3

preferences:
44.39 ms | 829 KiB | 4 Q