deioncube.xyz


Go Back

06/24/24

Php8.3. Better performance, better syntax, improved type safety.


PHP 8.3 continues to build on the improvements introduced in earlier versions of PHP 8, bringing new features, performance enhancements, and deprecations to keep the language modern and efficient.

PHP 8.3 is a major update of the PHP language.
It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvements, bug fixes, and general cleanup.

Improvements

  1. Performance Enhancements:

    • Various performance improvements have been made under the hood, making PHP 8.3 faster and more efficient.
  2. Generator Performance:

    • Generators have been optimized for better performance, particularly in scenarios involving large data sets or complex iterations.
  3. Improved Initializer Support for Attributes:

    • Attributes now support more types of initializers, including closures and objects.


Deprecations and Removals

  1. Deprecation of Ticks:

    • The declare(ticks=1) directive is deprecated in PHP 8.3 and will be removed in future versions. Alternatives should be considered for the same functionality.
  2. Deprecated Functions:

    • Several older functions have been deprecated, encouraging the use of modern alternatives. For example, utf8_encode and utf8_decode are deprecated.


Syntax and Language Changes

  1. Named Arguments with Variadic Functions:

    • Improvements in handling named arguments in variadic functions make the language more consistent and intuitive.
  2. Flexible Heredoc and Nowdoc Syntaxes:

    • Heredoc and Nowdoc syntaxes are more flexible and consistent, especially in edge cases.
  3. Standalone Null, False, and True Types:

    • The types null, false, and true can now be used as standalone types in type declarations.


Standard Library Updates

  1. New Functions:

    • Several new functions have been added to the standard library, providing more tools and utilities for developers.
  2. Improved Error Handling:

    • Error handling in certain standard library functions has been improved for better consistency and reliability.

Php8.3. Better performance, better syntax, improved type safety.


Written by: php
Share this news: