3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function bar(foo $x) { } } try { (new foo)->bar(new StdClass()); } catch (Exception $e) { echo "Exception ".get_class($e); } catch (TypeException $e) { echo "TypeException"; } catch (TypeError $e) { echo "TypeError"; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
155.57 ms | 3303 KiB | 10 Q