3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $a; private $b; public function __construct() { unset($this->a, $this->b); } public function __get(string $name) { $this->a = 123; $this->b = 'abc'; return $this->$name; } public function saySomething() : string { return $this->a . $this->b; } } echo (new Foo())->saySomething();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
152.28 ms | 2239 KiB | 10 Q