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.29, 8.2.0 - 8.2.20, 8.3.0 - 8.3.8
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:
106.63 ms | 402 KiB | 65 Q