3v4l.org

run code in 300+ PHP versions simultaneously
<?php class LazyException extends Exception { public function __construct() { parent::__construct(); $this->message = new class() { public function __toString() { return 'World'; } }; } } $e = new LazyException(); try { throw $e; } catch (\Exception $e) { echo 'Hello '; echo $e->getMessage(); echo "\n"; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
215.66 ms | 3299 KiB | 8 Q