3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $name = "Meow"; public function __toString() { throw new Exception('Op gei lalalei'); return $this->name; } } $test = new A(); try { $test->__toString(); } catch(Exception $e) { echo "Exception caught\n"; } try { echo $test; } catch(Exception $e) { echo "Exception caught\n"; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
164.01 ms | 2198 KiB | 10 Q