3v4l.org

run code in 200+ PHP versions simultaneously
<?php class SomeException extends \Exception { public function __toString() { return 'a'; } } $a = new SomeException(); echo (string) $a;
Output for 7.2.0 - 7.4.1
a