<?php class C { public readonly string $full; public function __construct( public readonly string $first, public readonly string $last, ) { unset($this->full); } public function __get(string $key) { print __FUNCTION__ . PHP_EOL; if ($key === 'full') { $this->full = "$this->first $this->last"; return $this->full; } } } $c = new C('Larry', 'Garfield'); print $c->first . PHP_EOL; print $c->full . PHP_EOL; print $c->full . PHP_EOL;
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`