Published in
DevHub
PHP 8.3, officially launched on November 23, brings a host of new features and improvements over its predecessor, PHP 8.2. Classified as a minor release, the updates in PHP 8.3 hold significant potential to streamline your coding process, potentially making it quicker and more error-free.
Here's an overview of the major, as well as the subtler, enhancements introduced in this latest version.
***
New Features in PHP 8.3
- Typed Class Constants
- Added json_validate function
- Dynamic class constant and Enum member fetch support
- New mb_str_pad function
- New #[\Override] attribute
- New stream_context_set_options function
- class_alias() supports aliasing built-in PHP classes
- PHP CLI Lint (php -l) supports linting multiple files at once
- Fallback value support for PHP INI Environment Variable syntax
- Random extension: New \Random\Randomizer::getFloat() and nextFloat() methods
- Random extension: New \Random\Randomizer::getBytesFromString method
- gc_status() returns additional GC information
Syntax/Functionality Changes in PHP 8.3
- SQLite3: New \SQLite3Exception, deprecations, and changes
- Built-in CLI Server $_SERVER['SERVER_SOFTWARE'] value changed for RFC3875 compliance
- Class constant type declarations in some PHP extension classes
- Granular DateTime Exceptions
- highlight_file and highlight_string output HTML changes
- unserialize(): Upgrade E_NOTICE errors to E_WARNING
Deprecations in PHP 8.3
- get_class() and get_parent_class() function calls without arguments deprecated
- Assert: assert_options(), ASSERT_* constants, and assert.* INI settings deprecated