PHP 8.3 Released: Typed Class Constants and json_validate()
PHP 8.3 added typed class constants, a dedicated json_validate() function, a new #[Override] attribute and deep-cloning improvements.
Historical Archive. This article documents an event from 2023 and is preserved with its original date for reference. It is not current news, and details may have changed since publication.
PHP 8.3 was released on November 23, 2023. It is an incremental but genuinely useful update that tightens the type system, adds a purpose-built JSON validation function, and gives developers a clearer way to express intent when overriding methods.
Typed class constants
The most notable addition is typed class constants. Before 8.3, a class constant could not carry an explicit type, which occasionally allowed inconsistent values to slip through when constants were overridden in child classes or interfaces. Typed class constants let developers declare the intended type, so the engine enforces it and tools can reason about it.
json_validate()
PHP 8.3 introduced json_validate(), a function that checks whether a string is valid JSON without fully decoding it into a PHP value. Previously, the common approach was to call json_decode() and inspect the result or error state, which allocated a full data structure just to answer a yes-or-no question. For large payloads that only need validation, json_validate() is more efficient.
The #[Override] attribute
The new #[Override] attribute lets a developer state that a method is intended to override a parent method. If the method does not actually override anything, for example because of a typo or a renamed parent method, the engine reports an error. This turns a subtle class of bugs into an immediate, obvious failure.
Cloning readonly properties and more
PHP 8.3 also improved the ability to reinitialise readonly properties during cloning, added new features to the randomizer, and made a range of smaller refinements. As always, the migration guide documents the deprecations and edge cases to check before upgrading.
Support timeline
Per php.net, PHP 8.3 had its initial stable release on November 23, 2023, with active support into the end of 2025 and security fixes into the end of 2027.
Related on Skillo
See also: PHP 8.4's property hooks and asymmetric visibility.
Sources
Published date reflects the original event date (2023-11-23). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.
Written by
Skillo Staff
0 Comments
Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.