Post by account_disabled on Feb 25, 2024 5:14:28 GMT
Officially released on November 26, 2020, the new PHP 8 version brings several interesting new features and functions, aimed at increasing performance and, at the same time, security. We have already made version 8 available on our cloud servers and dedicated servers with Plesk, from Obsidian version 18.0.32 and on our hosting plans equipped with multiphp . Discover our hosting plans Below, here are the main innovations introduced by PHP 8. Content index: JIT compilation Union Types Named Arguments Nullsafe operator Match expression More consistent comparisons of strings and numbers Consistent error types for native functions Attributes Promotion of constructor arguments to ownership JIT compilation One of the most anticipated features is the Just-in-time (JIT) Compiler.
By itself, the PHP language is translated into machine code Chinese Student Phone Number List during run time: the JIT compiler keeps track of frequently used code in the cache and tries to optimize the translation of the machine code so that it can be reused. This innovation aims to improve the performance of specific features and memory use. Shellrent Union Types Union Types allow you to allow two or more types per union making it possible to use any of these. Instead of using the PHPdoc annotation to combine types you can use the native union type declaration which is also valid at runtime.
Given PHP's dynamic typing, it is certainly useful to be able to specify multiple possible data types for a parameter, not just in annotations. Shellrent Named Arguments Upgrading to PHP 8 will specify the name of the parameter to pass, skipping optional parameters instead. This way, you can execute a function by passing an argument by name, not by position. As a result, the parameters will be order independent. Shellrent Nullsafe operator Instead of checking whether every single element of a structure is null, you can now use a chain of calls with the new nullsafe operator. When the evaluation of one of the elements in the chain fails, the execution of the entire chain is canceled and the result of the entire chain is null.
By itself, the PHP language is translated into machine code Chinese Student Phone Number List during run time: the JIT compiler keeps track of frequently used code in the cache and tries to optimize the translation of the machine code so that it can be reused. This innovation aims to improve the performance of specific features and memory use. Shellrent Union Types Union Types allow you to allow two or more types per union making it possible to use any of these. Instead of using the PHPdoc annotation to combine types you can use the native union type declaration which is also valid at runtime.
Given PHP's dynamic typing, it is certainly useful to be able to specify multiple possible data types for a parameter, not just in annotations. Shellrent Named Arguments Upgrading to PHP 8 will specify the name of the parameter to pass, skipping optional parameters instead. This way, you can execute a function by passing an argument by name, not by position. As a result, the parameters will be order independent. Shellrent Nullsafe operator Instead of checking whether every single element of a structure is null, you can now use a chain of calls with the new nullsafe operator. When the evaluation of one of the elements in the chain fails, the execution of the entire chain is canceled and the result of the entire chain is null.