PHP 8.4 Property Hooks: Simplify and Streamline Properties
Published on 2024-11-23
public int $postalCode {
set {
if (mb_strlen($value) !== 5) {
throw new \InvalidArgumentException('Must be 5 characters.');
}
$this->postalCode = $value;
}
}
Introducing Property Hooks in PHP 8.4 [...]
Read More