At the time of this recording, PHP 8.2 is in the beta release cycle so we can finally start to discuss what’s new and changed in the next release of PHP. In this article, we’ll discuss the timeline for the release and discuss some new features and changes we can expect to see. Again at the time of this recording, PHP 8.3 is scheduled to be released on November 23, 2023, after it’s gone through https://wiki.php.net/todo/php83.
readonly class Architect { public function __construct(public DateTimeImmutable $created) { } public function __clone() { $this->created = new DateTimeImmutable(); }} $item = new Architect(new DateTimeImmutable()); sleep(1); $cloned = clone $item; var_dump($item->created, $cloned->created); json_validate
$phpTekClass = new readonly class { public function __construct( public string $nextPhpTekDate = "Apr 23-25, 2024", ) {}}; $item = new $phpTekClass(); echo $item->nextPhpTekDate; Before 8.3 we’ll get a syntax error: Parse error: syntax error, unexpected token “readonly” in /home/user/scripts/code.php on line 2