'PHP 8.0 is a major update of the PHP language. It contains many new features and optimizations including named arguments, union types, attributes, constructor property promotion, match expression, nullsafe operator, JIT, and improvements in the type system, error handling, and consistency.', 'documentation' => 'Doc', 'main_title' => 'Released!', 'main_subtitle' => 'PHP 8.0 is a major update of the PHP language.
It contains many new features and optimizations including named arguments, union types, attributes, constructor property promotion, match expression, nullsafe operator, JIT, and improvements in the type system, error handling, and consistency.', 'upgrade_now' => 'Upgrade to PHP 8 now!', 'named_arguments_title' => 'Named arguments', 'named_arguments_description' => '
  • Specify only required parameters, skipping optional ones.
  • Arguments are order-independent and self-documented.
  • ', 'attributes_title' => 'Attributes', 'attributes_description' => 'Instead of PHPDoc annotations, you can now use structured metadata with PHP\'s native syntax.', 'constructor_promotion_title' => 'Constructor property promotion', 'constructor_promotion_description' => 'Less boilerplate code to define and initialize properties.', 'union_types_title' => 'Union types', 'union_types_description' => 'Instead of PHPDoc annotations for a combination of types, you can use native union type declarations that are validated at runtime.', 'ok' => 'Ok', 'oh_no' => 'Oh no!', 'this_is_expected' => 'This is what I expected', 'match_expression_title' => 'Match expression', 'match_expression_description' => '

    The new match is similar to switch and has the following features:

    ', 'nullsafe_operator_title' => 'Nullsafe operator', 'nullsafe_operator_description' => 'Instead of null check conditions, you can now use a chain of calls with the new nullsafe operator. When the evaluation of one element in the chain fails, the execution of the entire chain aborts and the entire chain evaluates to null.', 'saner_string_number_comparisons_title' => 'Saner string to number comparisons', 'saner_string_number_comparisons_description' => 'When comparing to a numeric string, PHP 8 uses a number comparison. Otherwise, it converts the number to a string and uses a string comparison.', 'consistent_internal_function_type_errors_title' => 'Consistent type errors for internal functions', 'consistent_internal_function_type_errors_description' => 'Most of the internal functions now throw an Error exception if the validation of the parameters fails.', 'jit_compilation_title' => 'Just-In-Time compilation', 'jit_compilation_description' => 'PHP 8 introduces two JIT compilation engines. Tracing JIT, the most promising of the two, shows about 3 times better performance on synthetic benchmarks and 1.5–2 times improvement on some specific long-running applications. Typical application performance is on par with PHP 7.4.', 'jit_performance_title' => 'Relative JIT contribution to PHP 8 performance', 'type_improvements_title' => 'Type system and error handling improvements', 'arithmetic_operator_type_checks' => 'Stricter type checks for arithmetic/bitwise operators', 'abstract_trait_method_validation' => 'Abstract trait method validation', 'magic_method_signatures' => 'Correct signatures of magic methods', 'engine_warnings' => 'Reclassified engine warnings', 'lsp_errors' => 'Fatal error for incompatible method signatures', 'at_operator_no_longer_silences_fatal_errors' => 'The @ operator no longer silences fatal errors.', 'inheritance_private_methods' => 'Inheritance with private methods', 'mixed_type' => 'mixed type', 'static_return_type' => 'static return type', 'internal_function_types' => 'Types for internal functions', 'email_thread' => 'Email thread', 'opaque_objects_instead_of_resources' => 'Opaque objects instead of resources for Curl, Gd, Sockets, OpenSSL, XMLWriter, and XML extensions', 'other_improvements_title' => 'Other syntax tweaks and improvements', 'allow_trailing_comma' => 'Allow a trailing comma in parameter lists RFC and closure use lists RFC', 'non_capturing_catches' => 'Non-capturing catches', 'variable_syntax_tweaks' => 'Variable Syntax Tweaks', 'namespaced_names_as_token' => 'Treat namespaced names as single token', 'throw_expression' => 'throw is now an expression', 'class_name_literal_on_object' => 'Allow ::class on objects', 'new_classes_title' => 'New Classes, Interfaces, and Functions', 'weak_map_class' => 'Weak Map class', 'stringable_interface' => 'Stringable interface', 'new_str_functions' => 'str_contains(), str_starts_with(), str_ends_with()', 'token_as_object' => 'token_get_all() object implementation', 'new_dom_apis' => 'New DOM Traversal and Manipulation APIs', 'footer_title' => 'Better performance, better syntax, improved type safety.', 'footer_description' => '

    For source downloads of PHP 8 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.

    ', ];