'PHP 8.1 is a major update of the PHP language. Enums, readonly properties, first-class callable syntax, fibers, intersection types, performance improvements and more.',
'main_title' => 'Released!',
'main_subtitle' => 'PHP 8.1 is a major update of the PHP language.
It contains many new features, including enums, readonly properties, first-class callable syntax, fibers, intersection types, performance improvements and more.',
'upgrade_now' => 'Upgrade to PHP 8.1 now!',
'documentation' => 'Doc',
'enumerations_title' => 'Enumerations',
'enumerations_content' => 'Use enum instead of a set of constants and get validation out of the box.',
'readonly_properties_title' => 'Readonly Properties',
'readonly_properties_content' => '
Readonly properties cannot be changed after initialization, i.e. after a value is assigned to them.
They are a great way to model value objects and data-transfer objects.
It is now possible to get a reference to any function – this is called first-class callable syntax.
', 'new_in_initializers_title' => 'New in initializers', 'new_in_initializers_content' => 'Objects can now be used as default parameter values, static variables, and global constants, as well as in attribute arguments.
This effectively makes it possible to use nested attributes.
', 'pure_intersection_types_title' => 'Pure Intersection Types', 'pure_intersection_types_content' => 'Use intersection types when a value needs to satisfy multiple type constraints at the same time.
It is not currently possible to mix intersection and union types together such as A&B|C
.
A function or method declared with the never
type indicates that it will not return a value and will either throw an exception or end the script’s execution with a call of die()
, exit()
, trigger_error()
, or something similar.
It is possible to declare final class constants, so that they cannot be overridden in child classes.
', 'octal_numeral_notation_title' => 'Explicit Octal numeral notation', 'octal_numeral_notation_content' => 'It is now possible to write octal numbers with the explicit 0o
prefix.
Fibers are primitives for implementing lightweight cooperative concurrency. They are a means of creating code blocks that can be paused and resumed like Generators, but from anywhere in the stack. Fibers themselves don\'t magically provide concurrency, there still needs to be an event loop. However, they allow blocking and non-blocking implementations to share the same API.
Fibers allow getting rid of the boilerplate code previously seen with Promise::then()
or Generator based coroutines. Libraries will generally build further abstractions around Fibers, so there\'s no need to interact with them directly.
PHP supported unpacking inside arrays through the spread operator before, but only if the arrays had integer keys. Now it is possible to unpack arrays with string keys too.
', 'performance_title' => 'Performance Improvements', 'performance_chart' => 'Symfony Demo App request time#[ReturnTypeWillChange]
attribute.',
'other_new_fsync_fdatasync' => 'New fsync
and fdatasync
functions.',
'other_new_array_is_list' => 'New array_is_list
function.',
'other_new_sodium_xchacha20' => 'New Sodium XChaCha20 functions.',
'bc_title' => 'Deprecations and backward compatibility breaks',
'bc_null_to_not_nullable' => 'Passing null to non-nullable internal function parameters is deprecated.',
'bc_return_types' => 'Tentative return types in PHP built-in class methods',
'bc_serializable_deprecated' => 'Serializable
interface deprecated.',
'bc_html_entity_encode_decode' => 'HTML entity en/decode functions process single quotes and substitute by default.',
'bc_globals_restrictions' => '$GLOBALS
variable restrictions.',
'bc_mysqli_exceptions' => 'MySQLi: Default error mode set to exceptions.',
'bc_float_to_int_conversion' => 'Implicit incompatible float to int conversion is deprecated.',
'bc_finfo_objects' => 'finfo Extension: file_info
resources migrated to existing finfo objects.',
'bc_imap_objects' => 'IMAP: imap resources migrated to IMAP\Connection
class objects.',
'bc_ftp_objects' => 'FTP Extension: Connection resources migrated to FTP\Connection
class objects.',
'bc_gd_objects' => 'GD Extension: Font identifiers migrated to GdFont
class objects.',
'bc_ldap_objects' => 'LDAP: resources migrated to LDAP\Connection
, LDAP\Result
, and LDAP\ResultEntry
objects.',
'bc_postgresql_objects' => 'PostgreSQL: resources migrated to PgSql\Connection
, PgSql\Result
, and PgSql\Lob
objects.',
'bc_pspell_objects' => 'Pspell: pspell, pspell config resources migrated to PSpell\Dictionary
, PSpell\Config
class objects.',
'footer_title' => 'Better performance, better syntax, improved type safety.',
'footer_content' => 'For source downloads of PHP 8.1 please visit the downloads page. Windows binaries can be found on the PHP for Windows site. The list of changes is recorded in the ChangeLog.
The migration guide is available in the PHP Manual. Please consult it for a detailed list of new features and backward-incompatible changes.
', ];