PHP 8 is here and heralds the next generation of the scripting language
Source: Heise.de added 28th Nov 2020The new PHP version 8 was released on time for the planned release date. The publication was preceded by years of renovation and expansion, in the course of which the language got rid of some legacy issues and introduced fundamental innovations. The approval was given by Release Manager Sara Golemon during the online conference betterCode organized by heise Developer and dpunkt.verlag ) PHP 8 while clicking the share button.
Acceleration through the JIT compiler The biggest innovation is the just-in-time compiler (JIT), a compiler strategy that derives intermediate code and converts it into architecture-dependent machine code – no longer via the Zend virtual machine, but “just in time” directly via the CPU. The team had been working on JIT support in PHP for some time in a separate development branch.
The new major version should go through the JIT for computationally intensive programs with a significant increase in performance compared to PHP 7. Developers can optionally switch on the tracing JIT compiler and use it to convert bytecode of frequently executed passages into native machine code. According to the editors, this method leads to more efficient execution of the bytecode than an intermediary virtual machine could offer.
Attribute and Union Types In addition, the team behind PHP has introduced attributes into the language with which metadata for code units can be embedded directly in the declaration. The concept is known from Java and C # (annotations in Java, attributes in C #). In the absence of real syntax for metadata, frameworks (such as Symfony), libraries (such as Doctrine) and tools (such as PHPUnit) have structured metadata from comment blocks and made it accessible via pseudo-languages.
The PHP -Team has also expanded the type system for PHP 8, adding the union types, which are known from programming languages such as TypeScript, C / C ++ and Rust. This is a collective declaration of two or more types, which can then be used depending on the situation (each of the types declared as possible can be used, others not).
Another new feature is that PHP 8 has supported JSON files since the alpha release in June. With an older code base, the switch to PHP 8 can lead to increased migration effort due to deprecations, which in view of the possible (according to PHP experts up to ten times) acceleration should be worthwhile depending on the computing intensity of a project.
Background to PHP 8 PHP (for nostalgics: “Personal Home Page Tools”, from Version 3 “PHP: Hypertext Preprocessor”) is 11 years old. The 1995 (about the same time as Java and JavaScript) by Rasmus Lerdorf started open source project was originally intended to create websites, whereby the Parser reads the code line by line. Starting with PHP 4, a compiler converted the program code into bytecode, which in the next step became executable code. Since version 5 PHP has increasingly offered object orientation. The initially missing scalar type information was a hurdle – since program code written in PHP can also be executed without type information, type-specific bytecode cannot always be generated. The actual data type is always only known at runtime and can change again when it is run again.
Mature open source project Today PHP is considered a mature programming language – the original hobby project has since become professional both in terms of project and application experienced and sometimes receive support from companies such as Facebook and Microsoft. However, there is no single company or foundation behind the project; a number of large and small sponsors have pushed the development forward over shorter or longer periods. In the meantime, Facebook in particular had committed itself to PHP and expanded the scope of the language through type information; Microsoft financed two developer positions as part of PHP 7 development. Apart from that, PHP has remained a community project, and the community continues to carry PHP even after larger sponsors have withdrawn.
More information about the release and the breaking changes can be found on the PHP blog remove. The release manager Sara Golemon had offered heise Developer a workshop insight as part of a conference on PHP 8 – in an interview, she tells us which hurdles had to be overcome and reports on the innovations .
Update notice : In the 7th paragraph a typo had crept in, the word “parser” has now been added.
(sih)
brands: Microsoft media: Heise.de keywords: Facebook Open Source
Related posts
Notice: Undefined variable: all_related in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 88
Notice: Undefined variable: all_related in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 88
Related Products
Notice: Undefined variable: all_related in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 91
Warning: Invalid argument supplied for foreach() in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 91