3v4l.org

run code in 300+ PHP versions simultaneously
<?php function initialize_properties_here(array $properties) { $properties['bar'] = 123; } class Foo { private int $bar = 123; public function __get(string $name) { $props = ['bar' => & $this->bar]; initialize_properties_here($props); return $this->$name; } } var_dump((new Foo())->bar);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
186.19 ms | 2186 KiB | 12 Q