3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooException extends Exception { public function __toString() { return Exception::__toString(); } } class Foo { public $prop = 'bar'; public function nonStatic() { return $this->prop; } } class Bar { public function anotherNonStatic() { return Foo::nonStatic(); } } $a = new FooException(); var_dump($a->__toString()); $b = new Bar(); var_dump($b->anotherNonStatic());

preferences:
32.47 ms | 402 KiB | 5 Q