3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class A { public function __toString() {} } var_dump((string) new A());
Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
Fatal error: Uncaught TypeError: A::__toString(): Return value must be of type string, none returned in /in/JKklI:4 Stack trace: #0 /in/JKklI(7): A->__toString() #1 {main} thrown in /in/JKklI on line 4
Process exited with code 255.

preferences:
59.91 ms | 406 KiB | 5 Q