3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $bar = null; public function __set($name, $value) { if ($name == 'bar') $this->bar = $value . $value; else throw new Exception('Property does not exists'); } public function __get($name) { if ($name == 'bar') return $this->bar; else throw new Exception('Property does not exists'); } } $obj = new foo(); $obj->bar = '123'; echo $obj->bar;

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
156.58 ms | 3276 KiB | 8 Q