PHP 8.3: What's New and Changed
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()
andnextFloat()
methodsRandom
extension: New\Random\Randomizer::getBytesFromString
methodgc_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
andhighlight_string
output HTML changesunserialize()
: UpgradeE_NOTICE
errors toE_WARNING