1<?php 2 3return [ 4 'common_header' => '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.', 5 'main_title' => 'Released!', 6 'main_subtitle' => 'PHP 8.1 is a major update of the PHP language.<br class="display-none-md"> It contains many new features, including enums, readonly properties, first-class callable syntax, fibers, intersection types, performance improvements and more.', 7 'upgrade_now' => 'Upgrade to PHP 8.1 now!', 8 'documentation' => 'Doc', 9 10 'enumerations_title' => 'Enumerations', 11 'enumerations_content' => 'Use enum instead of a set of constants and get validation out of the box.', 12 13 'readonly_properties_title' => 'Readonly Properties', 14 'readonly_properties_content' => '<p>Readonly properties cannot be changed after initialization, i.e. after a value is assigned to them.<br>They are a great way to model value objects and data-transfer objects.</p>', 15 16 'first_class_callable_syntax_title' => 'First-class Callable Syntax', 17 'first_class_callable_syntax_content' => '<p>It is now possible to get a reference to any function – this is called first-class callable syntax.</p>', 18 19 'new_in_initializers_title' => 'New in initializers', 20 'new_in_initializers_content' => '<p>Objects can now be used as default parameter values, static variables, and global constants, as well as in attribute arguments.</p> 21 <p>This effectively makes it possible to use <strong>nested attributes</strong>.</p>', 22 23 'pure_intersection_types_title' => 'Pure Intersection Types', 24 'pure_intersection_types_content' => '<p>Use intersection types when a value needs to satisfy multiple type constraints at the same time.</p> 25 <p>It is not currently possible to mix intersection and union types together such as <code>A&B|C</code>.</p>', 26 27 'never_return_type_title' => 'Never return type', 28 'never_return_type_content' => '<p>A function or method declared with the <code>never</code> 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 <code>die()</code>, <code>exit()</code>, <code>trigger_error()</code>, or something similar.</p>', 29 30 'final_class_constants_title' => 'Final class constants', 31 'final_class_constants_content' => '<p>It is possible to declare final class constants, so that they cannot be overridden in child classes.</p>', 32 33 'octal_numeral_notation_title' => 'Explicit Octal numeral notation', 34 'octal_numeral_notation_content' => '<p>It is now possible to write octal numbers with the explicit <code>0o</code> prefix.</p>', 35 36 'fibers_title' => 'Fibers', 37 'fibers_content' => '<p>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.</p><p>Fibers allow getting rid of the boilerplate code previously seen with <code>Promise::then()</code> or Generator based coroutines. Libraries will generally build further abstractions around Fibers, so there\'s no need to interact with them directly.</p>', 38 39 'array_unpacking_title' => 'Array unpacking support for string-keyed arrays', 40 'array_unpacking_content' => '<p>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.</p>', 41 42 'performance_title' => 'Performance Improvements', 43 'performance_chart' => '<strong>Symfony Demo App request time</strong><br> 44 25 consecutive runs, 250 requests (sec)<br> 45 (less is better)<br>', 46 'performance_results_title' => 'The result (relative to PHP 8.0):', 47 'performance_results_symfony' => '23.0% Symfony Demo speedup', 48 'performance_results_wordpress' => '3.5% WordPress speedup', 49 'performance_related_functions_title' => 'Performance related features in PHP 8.1:', 50 'performance_jit_arm64' => 'JIT backend for ARM64 (AArch64)', 51 'performance_inheritance_cache' => 'Inheritance cache (avoid relinking classes in each request)', 52 'performance_fast_class_name_resolution' => 'Fast class name resolution (avoid lowercasing and hash lookup)', 53 'performance_timelib_date_improvements' => 'timelib and ext/date performance improvements', 54 'performance_spl' => 'SPL file-system iterators improvements', 55 'performance_serialize_unserialize' => 'serialize/unserialize optimizations', 56 'performance_internal_functions' => 'Some internal functions optimization (get_declared_classes(), explode(), strtr(), strnatcmp(), dechex())', 57 'performance_jit' => 'JIT improvements and fixes', 58 59 'other_new_title' => 'New Classes, Interfaces, and Functions', 60 'other_new_returntypewillchange' => 'New <code>#[ReturnTypeWillChange]</code> attribute.', 61 'other_new_fsync_fdatasync' => 'New <code>fsync</code> and <code>fdatasync</code> functions.', 62 'other_new_array_is_list' => 'New <code>array_is_list</code> function.', 63 'other_new_sodium_xchacha20' => 'New Sodium XChaCha20 functions.', 64 65 'bc_title' => 'Deprecations and backward compatibility breaks', 66 'bc_null_to_not_nullable' => 'Passing null to non-nullable internal function parameters is deprecated.', 67 'bc_return_types' => 'Tentative return types in PHP built-in class methods', 68 'bc_serializable_deprecated' => '<code>Serializable</code> interface deprecated.', 69 'bc_html_entity_encode_decode' => 'HTML entity en/decode functions process single quotes and substitute by default.', 70 'bc_globals_restrictions' => '<code>$GLOBALS</code> variable restrictions.', 71 'bc_mysqli_exceptions' => 'MySQLi: Default error mode set to exceptions.', 72 'bc_float_to_int_conversion' => 'Implicit incompatible float to int conversion is deprecated.', 73 'bc_finfo_objects' => 'finfo Extension: <code>file_info</code> resources migrated to existing finfo objects.', 74 'bc_imap_objects' => 'IMAP: imap resources migrated to <code>IMAP\Connection</code> class objects.', 75 'bc_ftp_objects' => 'FTP Extension: Connection resources migrated to <code>FTP\Connection</code> class objects.', 76 'bc_gd_objects' => 'GD Extension: Font identifiers migrated to <code>GdFont</code> class objects.', 77 'bc_ldap_objects' => 'LDAP: resources migrated to <code>LDAP\Connection</code>, <code>LDAP\Result</code>, and <code>LDAP\ResultEntry</code> objects.', 78 'bc_postgresql_objects' => 'PostgreSQL: resources migrated to <code>PgSql\Connection</code>, <code>PgSql\Result</code>, and <code>PgSql\Lob</code> objects.', 79 'bc_pspell_objects' => 'Pspell: pspell, pspell config resources migrated to <code>PSpell\Dictionary</code>, <code>PSpell\Config</code> class objects.', 80 81 'footer_title' => 'Better performance, better syntax, improved type safety.', 82 'footer_content' => '<p> 83 For source downloads of PHP 8.1 please visit the <a href="https://www.php.net/downloads">downloads</a> page. 84 Windows binaries can be found on the <a href="https://windows.php.net/download">PHP for Windows</a> site. 85 The list of changes is recorded in the <a href="https://www.php.net/ChangeLog-8.php#PHP_8_1">ChangeLog</a>. 86 </p> 87 <p> 88 The <a href="/manual/en/migration81.php">migration guide</a> is available in the PHP Manual. Please 89 consult it for a detailed list of new features and backward-incompatible changes. 90 </p>', 91]; 92