3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $foo; private $baz = "okay"; public function __construct() { $this->foo = 'bar'; } public function getFoo(){ $foo = "fooey"; return $this->foo; } public function getBaz(){ return $this->baz; } public function DoSomething(){ echo $foo; echo $this->getFoo(),"\n"; echo $this->getBaz(); } } $t = new Test(); $t->DoSomething();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
194.5 ms | 2603 KiB | 10 Q