Ian Littman
brew tap shivammathur/php
brew install php@8.4
WARNING: This is an alpha. Don't deploy this to production.
class User implements Named
{
private bool $isModified = false;
public function __construct(private string $first, private string $last){}
public string $fullName {
// Override the "read" action with arbitrary logic.
get => $this->first . " " . $this->last;
// Override the "write" action with arbitrary logic.
set {
[$this->first, $this->last] = explode(' ', $value, 2);
$this->isModified = true;
}
}
}