3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface I { public function __toString(): string; } enum E implements I { // public function __toString(): string {} }
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
Fatal error: Enum E must implement 1 abstract private method (I::__toString) in /in/ChAkh on line 7
Process exited with code 255.
Output for 8.1.0 - 8.1.33
Fatal error: Class E contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (I::__toString) in /in/ChAkh on line 7
Process exited with code 255.

preferences:
62.66 ms | 407 KiB | 5 Q