SlideShare a Scribd company logo
1 of 43
8.
0
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 1
Roadmap
Alpha1
•25/06/2020
RC3
•29/10/2020
RC4
•12/11/2020
Stable
Release
•26/11/2020
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 2
https://wiki.php.net/todo/php80
Exemple
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 3
Named arguments
Avant PHP 8 PHP 8
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 4
Named arguments : From Array
Avant PHP 8 PHP 8
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 5
Named arguments : From Array
Avant PHP 8 PHP 8
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 6
Named arguments : From Array
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 7
Union types
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 8
Union types
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 9
Avant PHP 8 PHP 8
?string|Stringable # null|string|Stringable
Avant PHP 8 PHP 8
Mixed type
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 10
null|callable|int|float|bool|string|array|object|resource
Static return type
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 11
Avant
PHP 8
PHP 8
https://wiki.php.net/rfc/static_return_type
Static return type
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 12
Avant
PHP 8
PHP 8
https://wiki.php.net/rfc/static_return_type
Avant PHP 8 PHP 8
Constructor property promotion
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 13
Avant PHP 8 PHP 8
Constructor property promotion
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 14
Nullsafe Operator
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 15
Avant PHP 8 PHP 8
$object1->method()?->method()
Match expression
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 16
Avant
PHP 8
PHP 8
Avant
PHP 8
PHP 8
::class on objects
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 17
New Stringable interface
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 18
is_string($user->getEmail())
Trailing comma in parameters list
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 19
Variable syntax tweaks
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 20
Avant
PHP 8
PHP 8
new (expression)(...$args) | $obj instanceof (expression)
Variable syntax tweaks
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 21
Avant
PHP 8
PHP 8
new (expression)(...$args) | $obj instanceof (expression)
Avant
PHP 8
PHP 8
Concatenation precedence
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 22
Avant
PHP 8
PHP 8
Namespaces can use reserved PHP
names
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 23
Attributes Vs Annotations
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 24
Attributes Vs Annotations
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 25
Attributes Vs Annotations Doctrine
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 26
https://github.com/ybenhssaien/authorization-bundle/blob/1.0/AuthorizationMap.php
Attributes Vs Annotations doctrine
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 27
https://github.com/ybenhssaien/authorization-bundle/blob/1.0/AuthorizationMap.php
Attributes
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 28
#[…..]
Attributes
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 29
Attributes
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 30
Throw expression
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 31
Avant
PHP 8
PHP 8
Exception catch sans variable
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 32
Avant
PHP 8
PHP 8
JIT (Just In Time)
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 33
Sans OPCache Avec OPCache Avec JIT
JIT (Just In Time)
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 34
Avec JIT
php.ini :
opcache.jit_buffer_size = 0 // Disabled
opcache.jit_buffer_size = 1024K
opcache.jit = 1235 // CRTO : Cpu Register Trigger Optimization
https://wiki.php.net/rfc/jit
C - CPU specific optimization flags
0 - none
1 - enable AVX instruction generation
R - Register allocation
0 - don't perform register allocation
1 - use local liner-scan register allocator
2 - use global liner-scan register allocator
T - JIT trigger
0 - JIT all functions on first script load
1 - JIT function on first execution
2 - Profile on first request and compile hot functions on second request
3 - Profile on the fly and compile hot functions
4 - Compile functions with @jit tag in doc-comments
O - Optimization level
0 - don't JIT
1 - minimal JIT (call standard VM handlers)
2 - selective VM handler inlining
3 - optimized JIT based on static type inference of individual function
4 - optimized JIT based on static type inference and call tree
5 - optimized JIT based on static type inference and inner procedure analyses
Inheritance with private methods
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 35
Avant
PHP 8
PHP 8
WeakMap
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 36
https://wiki.php.net/rfc/weak_maps
WeakMap Vs SplObjectStorage
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 37
[DateTime, DateTimeImmutable]
::createFromInterface()
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 38
Avant
PHP 8
PHP 8
DateTimeImmutable::createFromMutable() DateTime::createFromImmutable()
Nouvelles fonctions :
str_contains / str_starts_with / str_ends_with
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 39
Nouvelles fonctions : fdiv()
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 40
Nouvelles fonctions : get_debug_type()
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 41
Références
https://pociot.dev/32-php-8-try-out-all-new-features : Exemples des nouvelles fonctionnalités
https://3v4l.org/jfUsh : Code démo & Tester en ligne
https://stitcher.io/blog/new-in-php-8 : Présentation des nouvelles fonctionnalités + explications
https://github.com/php/php-src/blob/PHP-8.0/UPGRADING : La liste complète des nouvelles
fonctionnalités
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 42
Merci pour votre attention
https://www.linkedin.com/in/youssefbenhssaien
https://github.com/ybenhssaien
https://medium.com/@youssefbenhssaien
01/11/2020 PHP 8 PAR YOUSSEF BENHSSAIEN 43

More Related Content

Similar to PHP 8 - nouvelles fonctionnalités

PHP Development Tools 2.0 - Success Story
PHP Development Tools 2.0 - Success StoryPHP Development Tools 2.0 - Success Story
PHP Development Tools 2.0 - Success StoryMichael Spector
 
Java Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) SpecificationJava Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) SpecificationJohn Lewis
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8Wim Godden
 
Na pomezi php a vue.js
Na pomezi php a vue.jsNa pomezi php a vue.js
Na pomezi php a vue.jsPeckaDesign.cz
 
PHP 8: What's New and Changed
PHP 8: What's New and ChangedPHP 8: What's New and Changed
PHP 8: What's New and ChangedAyesh Karunaratne
 
Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and Pierre Joye
 
Last 2 Months in PHP - July & August 2016
Last 2 Months in PHP - July & August 2016Last 2 Months in PHP - July & August 2016
Last 2 Months in PHP - July & August 2016Eric Poe
 
PyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document GenerationPyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document Generation용선 이
 
Php 7 compliance workshop singapore
Php 7 compliance workshop singaporePhp 7 compliance workshop singapore
Php 7 compliance workshop singaporeDamien Seguy
 
Last Month in PHP - October 2016
Last Month in PHP - October 2016Last Month in PHP - October 2016
Last Month in PHP - October 2016Eric Poe
 
PHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traitsPHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traitsGraham Weldon
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7Damien Seguy
 
Github.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-phpGithub.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-phpSan jay
 
The better PHP API (EN)
The better PHP API (EN)The better PHP API (EN)
The better PHP API (EN)boen_robot
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysqlProgrammer Blog
 
PHP. Trends, implementations, frameworks and solutions
PHP. Trends, implementations, frameworks and solutionsPHP. Trends, implementations, frameworks and solutions
PHP. Trends, implementations, frameworks and solutionsOleg Zinchenko
 

Similar to PHP 8 - nouvelles fonctionnalités (20)

PHP Development Tools 2.0 - Success Story
PHP Development Tools 2.0 - Success StoryPHP Development Tools 2.0 - Success Story
PHP Development Tools 2.0 - Success Story
 
Java Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) SpecificationJava Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) Specification
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
 
Na pomezi php a vue.js
Na pomezi php a vue.jsNa pomezi php a vue.js
Na pomezi php a vue.js
 
PHP 8: What's New and Changed
PHP 8: What's New and ChangedPHP 8: What's New and Changed
PHP 8: What's New and Changed
 
Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and Php 7.x 8.0 and hhvm and
Php 7.x 8.0 and hhvm and
 
Last 2 Months in PHP - July & August 2016
Last 2 Months in PHP - July & August 2016Last 2 Months in PHP - July & August 2016
Last 2 Months in PHP - July & August 2016
 
PyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document GenerationPyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document Generation
 
Php 7 compliance workshop singapore
Php 7 compliance workshop singaporePhp 7 compliance workshop singapore
Php 7 compliance workshop singapore
 
Rebuilding our Foundation
Rebuilding our FoundationRebuilding our Foundation
Rebuilding our Foundation
 
Last Month in PHP - October 2016
Last Month in PHP - October 2016Last Month in PHP - October 2016
Last Month in PHP - October 2016
 
PHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traitsPHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traits
 
Php7
Php7Php7
Php7
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
 
Php NotesBeginner
Php NotesBeginnerPhp NotesBeginner
Php NotesBeginner
 
Github.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-phpGithub.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-php
 
Php manish
Php manishPhp manish
Php manish
 
The better PHP API (EN)
The better PHP API (EN)The better PHP API (EN)
The better PHP API (EN)
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysql
 
PHP. Trends, implementations, frameworks and solutions
PHP. Trends, implementations, frameworks and solutionsPHP. Trends, implementations, frameworks and solutions
PHP. Trends, implementations, frameworks and solutions
 

Recently uploaded

How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabbereGrabber
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersEmilyJiang23
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems ApproachNeo4j
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdfkalichargn70th171
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Soroosh Khodami
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfQ-Advise
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfkalichargn70th171
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfMehmet Akar
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionMohammed Fazuluddin
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationWave PLM
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfVictor Lopez
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionWave PLM
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)Max Lee
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...rajkumar669520
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAlluxio, Inc.
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfTestgrid.io
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1KnowledgeSeed
 

Recently uploaded (20)

How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdf
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 

PHP 8 - nouvelles fonctionnalités