📒 

PHP 8.3 is the latest evolution of the popular server-side programming language. This version introduced a number of new features and improvements, giving developers more tools to create efficient and scalable web applications. In this article we will look at the key changes that will be useful for server users.

What’s new in PHP 8.3

PHP 8.3 version has a number of new improvements and advantages in use. And also adding a new type of functionality that will help you work with arrays. Many new implementations and updates are listed below

JIT compilation

PHP 8.3 introduced Just-In-Time Compilation (JIT) to improve code execution performance. Just-in-time (JIT) compilation translates PHP bytecode into machine code at runtime, which can significantly speed up applications. This is especially useful for highly loaded servers where maximum performance is required. JIT example

php -d jit=on script.php

Adding array_is_list function

The array_is_list function checks whether an array is a list. This is convenient when working with arrays where the keys start at 0 and go sequentially. This innovation can be useful in scenarios where you need to determine whether an array is a list or an associative array. Example of using array_is_list:

$array = [0 => 'apple', 1 => 'banana', 2 => 'cherry'];
var_dump(array_is_list($array)); // bool(true)

Improvements to the Type System.

This is one of the important improvements in PHP 8.3, the type system has been improved. It is now possible to specify the type for class properties, as well as for static methods. This will make it easier to work with the code, reduce possible errors and increase the readability of the code. An example of using a type specification for a class property:

class User {
    public int $id;
    public int $id;
}

Improvements in String Functions

New features and improvements have been made to working with strings. For example, the str_contains function can now work with arrays of strings, providing a more convenient way to search for substrings in an array. Example of using str_contains with a string array:

$array = ['apple', 'banana', 'cherry'];
var_dump(str_contains($array, 'banana')); //bool(true)