PHP 8.3 – what awaits us?

The new version of PHP 8.3, is in progress and will be available soon. Like most new versions, 8.3 also brings with it some improvements and innovations. In this Article Let's introduce you to the most important changes you can expect in PHP 8.3.

What's new in PHP 8.3?

There are some new features and improvements in PHP 8.3. For example, the function was 'fetch()' added, with the one data from a Result object. The array function 'array_key_first()' has also been added. This function returns the first key of an array.

Other new features in PHP 8.3 include:

– The support for JIT (Just in Time Compilation)
– Improved Runtimes for modern CPUs
– New on demand memory manager
– Support for the Standard ML programming language

Compatibility with previous versions

PHP 8.3 builds on the changes in PHP 8.0 and is compatible with previous versions. This means that most scriptsthat work on PHP 8.0 or later should also work on PHP 8.3. However, there are some changes you should be aware of. For example, the type »resource« removed in PHP 8.3. This means that certain functions that come with Resources work, may stop working. Furthermore, some functions were removed or renamed in PHP 8.3. So if you have a Skript that uses any of these features, you may need to adjust or replace it.

Advantages and disadvantages of PHP 8.3

PHP 8.3 brings some new features and changes. Some of these innovations can be seen as improvements, while others bring disadvantages. In this article the Advantages and disadvantages examined by PHP 8.3.

One of the biggest advantages of PHP 8.3 is the support for JIT (Just-In-Time) compilation. This allows the Zend Engine to compile PHP code into native machine language, increasing execution speed. The storage requirements are also reduced because the -- no longer needs to be interpreted. Furthermore, some are new language features planned, including Union Types 2.0, Pattern matching as well as support for clang 9 and LLVM 10.

However, there are also some disadvantages Migrating to PHP 8.3. On the one hand, there may be compatibility problems with older versions of PHP. JIT compilation can also lead to problems as some hosting providers have so far not support.

The new JIT compiler engine

The new JIT compiler engine in PHP 8.3 is intended to significantly speed up the execution of PHP code. Previously, the PHP interpreter was called one every time scripts restarted, which took quite a bit of time. With the new engine, this process should be significantly optimized.

The new engine is already available in the current development version of PHP 8.3 and can be tested. However, it is not yet fully developed and it could still be Error appear. As soon as PHP 8.3 is finally released, the new engine should run stably and bring a noticeable increase in speed.

The new typo finder

The new Typofinder function in PHP 8.3 is intended to Search for certain types of variables. Previously, searching for a specific type required you to perform a regular expression search, which could be very time-consuming. With the new feature, you can now easily search for the type you want and the results will appear immediately.

Warp speed comparisons

1. PHP 8.3 is faster than its predecessor
2. The new JIT compiler makes it possible
3. Thanks to Just-In-Time (JIT) compilation, PHP 8.3 can be up to 3x faster than PHP 7
4. It means that Webseiten and applications running on PHP 8.3 will be significantly faster.

Methods for calculating faster

Last year the PHP version was 8.0 released, which brought with it some major innovations, including a JIT compiler. With the new version 8.3 the... Performance be further improved.

A new algorithm for To calculate of factorials (n!), which will be included in PHP 8.3, is already said to be 3-5 times faster than the previous algorithm (see benchmark).

Further improvements concern this to generate of hash values ​​as well as the encoding and decoding of Unicode characters.

San operator overloading

The new PHP 8.3 release comes with a number of improvements for the handling of operator methods. The changes are intended to help... Make code more readable and maintainable and eliminate errors to avoid.

Previously it was possible to define any operator as a method. This can lead to very confusing code, especially when multiple operators are defined in a class. With PHP 8.3 there are now some restrictions when defining operator methods. Certain operators can only be defined under certain conditions.

Another innovation is the possibility of using the »space ship« operator (=>) determine whether a value is less than, equal to, or greater than another value. This is particularly useful when working with sorted arrays.

reflection API

The Reflection API is part of the core PHP functionality, so you usually don't need an additional library. She makes it possible Developers, query metadata of classes, methods and functions.

With PHP 8.3 some improvements have been made to the Reflection API. The new version contains a number of new features as well as bug fixes and performance improvements. Overall, working with the Reflection API should now be easier than before.

FFI – Foreign Function Interface

FFI is a foreign function interface for PHP that allows executable binaries to be used in other languages.

The interface allows developers to use functions from other Languages to integrate into PHP scripts and thus increase the performance of PHP applications. The new feature will be available with version 8.3 of PHP and is intended to be primarily useful for developing extensions and applications that need to access other systems or components.

Rector and PHPStan for a faster start

Rector is an automated code rewriter that can help you move to PHP 8.3. With its help, you can integrate new functions into your existing code and immediately benefit from the advantages new standards benefit.

PHPStan is a static code analysis tool to help you find errors and inconsistencies in your code helps. Thanks to its extensive testing criteria, you can quickly identify and correct problematic areas. This way you can ensure that your code runs error-free even under the new conditions.

Conclusion about PHP 8.3

Generally speaking it is PHP 8.3 a highly recommended upgrade version. Most of the innovations are well thought out and can significantly simplify or speed up development. Of course, there are a few small changes that sometimes seem a bit unusual, but overall PHP 8.3 is a big step forward for them Language.

Note..is important!

All external sites linked on this website are independent sources. 
These links are not sponsored and no financial contribution was received for their inclusion. 
All information on this website is provided without guarantee.
This site is a private project by Jan Domke and solely reflects personal opinions and experiences.

Jan Domke

Prompt Engineer | Social Media Manager | Hosting Manager | Web administrator

I have been running the online magazine privately since the end of 2021 SEO4Business and thus turned my job into a hobby.
I have been working as a since 2019 Senior Hosting Manager, at one of the largest internet and marketing agencies in Germany and am constantly expanding my horizons.

Jan Domke