PHP 8 Revealed: Use Attributes, the JIT Compiler, Union Types, and More for Web Development
()
About this ebook
Discover the new and updated features of PHP 8, such as the JIT compiler, union types, and attributes, with code examples of each. For each feature, the author includes real-life cases for its use and explains its benefits.
What You Will Learn
- Utilize the new features of PHP 8 and modern development technologies
- Work with the JIT compiler in PHP 8
- Discover PHP 8 using real-life cases
- Increase your available resources to become more valuable in your development team
Who This Book Is For
Experienced PHP programmers new to PHP 8.
Related to PHP 8 Revealed
Related ebooks
PHP 8 Objects, Patterns, and Practice: Mastering OO Enhancements, Design Patterns, and Essential Development Tools Rating: 0 out of 5 stars0 ratingsMicrosoft Conversational AI Platform for Developers: End-to-End Chatbot Development from Planning to Deployment Rating: 0 out of 5 stars0 ratingsInstant Hands-on Testing with PHPUnit How-to Rating: 0 out of 5 stars0 ratingsReSharper Essentials Rating: 4 out of 5 stars4/5FuelPHP Application Development Blueprints Rating: 0 out of 5 stars0 ratingsJargonaut Express: Essential Idioms for the Astute Business Speaker Rating: 0 out of 5 stars0 ratingsMastering VMware vSphere 6 Rating: 5 out of 5 stars5/5Learning Firefox OS Application Development Rating: 0 out of 5 stars0 ratingsKotlin Unleashed: Harnessing the Power of Modern Android Development Category Rating: 0 out of 5 stars0 ratingsMy First Webpocalypse: Beginner HTML, CSS, and Usability (Virtual Boxed Set): Undead Institute Rating: 0 out of 5 stars0 ratingsAcademic Writing for Military Personnel, revised edition: Revised Edition Rating: 0 out of 5 stars0 ratingsMetric system The Ultimate Step-By-Step Guide Rating: 0 out of 5 stars0 ratingsIntroducing Bootstrap 4: Create Powerful Web Applications Using Bootstrap 4.5 Rating: 0 out of 5 stars0 ratingsWindows 8.1 Bible Rating: 0 out of 5 stars0 ratingsThe Ruby Workshop: Develop powerful applications by writing clean, expressive code with Ruby and Ruby on Rails Rating: 0 out of 5 stars0 ratingsFrench Phrasebook: 35 French Dialogues for Travel and Everyday Life Rating: 0 out of 5 stars0 ratingsBecoming Comfortable with Unity Rating: 0 out of 5 stars0 ratingsModern CSS: Master the Key Concepts of CSS for Modern Web Development Rating: 0 out of 5 stars0 ratingsLearn Programming by Coding Like a Professional: Create Games, Apps, & Programs Rating: 0 out of 5 stars0 ratingsVisual Studio VS The Ultimate Step-By-Step Guide Rating: 0 out of 5 stars0 ratingsiOS 6 Application Development For Dummies Rating: 4 out of 5 stars4/5More Advanced CSS: Zombie in a Ballgown: Undead Institute Rating: 0 out of 5 stars0 ratingsXML Net Developers Guide Rating: 0 out of 5 stars0 ratingsWeb Search Engine A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsC++ All-in-One For Dummies Rating: 4 out of 5 stars4/5Software business A Complete Guide Rating: 0 out of 5 stars0 ratingsConcurrency Control in Distributed Database Systems Rating: 0 out of 5 stars0 ratingsMy Conversations With God AI Rating: 0 out of 5 stars0 ratings
Computers For You
Deep Search: How to Explore the Internet More Effectively Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 5 out of 5 stars5/5How to Create Cpn Numbers the Right way: A Step by Step Guide to Creating cpn Numbers Legally Rating: 4 out of 5 stars4/5Network+ Study Guide & Practice Exams Rating: 4 out of 5 stars4/5Procreate for Beginners: Introduction to Procreate for Drawing and Illustrating on the iPad Rating: 0 out of 5 stars0 ratingsThe ChatGPT Millionaire Handbook: Make Money Online With the Power of AI Technology Rating: 0 out of 5 stars0 ratings101 Awesome Builds: Minecraft® Secrets from the World's Greatest Crafters Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Ultimate Guide to Mastering Command Blocks!: Minecraft Keys to Unlocking Secret Commands Rating: 5 out of 5 stars5/5AP Computer Science Principles Premium, 2024: 6 Practice Tests + Comprehensive Review + Online Practice Rating: 0 out of 5 stars0 ratingsCompTIA Security+ Practice Questions Rating: 2 out of 5 stars2/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5CompTIA IT Fundamentals (ITF+) Study Guide: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsChildhood Unplugged: Practical Advice to Get Kids Off Screens and Find Balance Rating: 0 out of 5 stars0 ratingsChatGPT Ultimate User Guide - How to Make Money Online Faster and More Precise Using AI Technology Rating: 0 out of 5 stars0 ratingsPractical Lock Picking: A Physical Penetration Tester's Training Guide Rating: 5 out of 5 stars5/5Elon Musk Rating: 4 out of 5 stars4/5Dark Aeon: Transhumanism and the War Against Humanity Rating: 5 out of 5 stars5/5The Professional Voiceover Handbook: Voiceover training, #1 Rating: 5 out of 5 stars5/5Master Builder Roblox: The Essential Guide Rating: 4 out of 5 stars4/5Hacking: Ultimate Beginner's Guide for Computer Hacking in 2018 and Beyond: Hacking in 2018, #1 Rating: 4 out of 5 stars4/5
Reviews for PHP 8 Revealed
0 ratings0 reviews
Book preview
PHP 8 Revealed - Gunnard Engebreth
© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
G. EngebrethPHP 8 Revealedhttps://doi.org/10.1007/978-1-4842-6818-6_1
1. JIT Compiler
Gunnard Engebreth¹
(1)
Madison, WI, USA
Date: 2019-01-28
Author: Dmitry Stogov, Zeev Suraski
Vote: 50/2
A concern I have with the current RFC is a lack of a good case for why it should be necessary; the case for JIT is based on performance benefits, but the examples provided are unconvincing to me because they seem too contrived. Both bench.php and drawing fractals represent a best-case example for a JIT, small programs which do heavy arithmetic and not much else. Maybe PHP being able to be used for this kind of software would be cool, but it wouldn’t justify the added complexity (and for that matter security headaches) of adding a JIT to PHP given C, C++, FORTRAN and so on already exist and are better-suited to it.
—Andrea Faulds
The concept of just-in-time (JIT) has not changed much in philosophy since the days of Henry Ford and his production line, but the implementation has. JIT has been in use since the 1960s and refers to any translation performed dynamically in a program after its execution. Thirteen years ago, Rasmus Lerdorf lovingly wrote this opinion on the introduction of JIT into PHP.
This comes up once or twice a year. The machine code you compile to is going to end up looking a lot like the current executor since you don’t have strong types to help you optimize anything. You’d still need to pass the unions around and do runtime type juggling and all the overhead that comes along with that. The idea behind PHP from day one was that it was an environment for wrapping compiled code. Things that are performance critical are written in C/C++ and things that aren’t are left in the PHP templates. Whether you issue an SQL query from PHP or from a compiled C program doesn’t affect the overall performance of the system so you might as well do that from PHP. If you are calculating a fractal, you write it in C and expose it to PHP with a get_fractal($args) function call so you can mark it up and easily change the args passed to the underlying function. It is really important for PHP to have as little overhead as possible between itself and the speed-critical code behind it and less important that the userspace executor is fast. That doesn’t mean it should be slow. It should be as fast as we can make it, but not at the cost of convenience.
To this day, this argument still holds water and there is great hope and promise that the JIT implementation in PHP 8 will add and not subtract from the language and purpose of PHP.
Optimization in PHP has been at the forefront of the language ever since its emergence and domination over PERL in the early 2000s and we still see this trend today. There are obvious examples such as ternary