SlideShare a Scribd company logo
PHP7.1 New Features & Performance
@Laruence
About Me
• Author of Yaf, Yar, Yac, Yaconf, Taint, Lua, etc
• Maintainer of APC, Zend Opcache, Msgpack
• PHP core developer since 2011
• Zend consultant since 2013
• Core author of PHP7
• Chief Architect at Lianjia
PHP
• 20 years history
• Most popular Web service program
language
• Over 82% sites are use PHP as
server side program language
• Latest version is PHP-7.1
PHP71
• Nullable types
• Void return type
• Iterable pseudo-type
• Class constant visibility modifiers
• Specify keys in list()
• Square bracket syntax for list()
• Catching multiple exception types
• Missing arguments Excetpion
• Warn about invalid strings in arithmetic
• Generalize support of negative string offsets
• ….
Nullable types
• An enhancement for typehints
return type parameters
Void return types
• An enhancement for return type hint
Iterable Pseudo type
• Iterable accepts any array or object implementing Traversable
• Iterable can also be used in return type
Class constant visibility modifiers
• Support class constant visibility
Specify keys in list()
• An enhancement for list()
• Also works in foreach
specify keys in list specify keys in list with foreach
Square backtrace for list()
• Continuation syntax for short array syntax introduced in 5.4
• Also works in foreach too
Catching multiply exception types
• Allow catching multiply exception types in single catch
normal way PHP71 way
Missing arguments exception
• Disable calling “user” functions with insufficient actual parameters
before 71
after 71
Warn about invalid strings in arithmetic
• Produce E_NOTICE or E_WARNING when using invalid numeric
strings with arithmetic operators
Generalize support of negative string offsets
• Support of negative string offsets when it make sense
One More thing
PHP71 Performance
• Over 10% Perfromance improvement
0.901	
1.022	
2.991	
3.045	
3.102	
3.762	
5.318	
6.527	
13.424	
0	 2	 4	 6	 8	 10	 12	 14	 16	
PHP-7.1	
PHP-7.0	
PHP-5.6	
PHP-5.5	
PHP-5.4	
PHP-5.3	
PHP-5.2	
PHP-5.1	
PHP-5.0	
bench.php
Type specific opcode handlers
ZEND_ADD
ZEND_ADD_LONG_LONG
Type Inference system
• Part work of our JIT in 2013
normal branch loop
Static Single-Assignment Form
• An intermediate representation, variable is assigned exactly once
• Explicit use-def chain
Type Inference
• What’s ? ’s type at ? point
• Computed in compiling time
Type Specific opcode handler
• Use type specific opcode handler if possible
Type Inference system
• A tedious work
• And we can only get ~30% type-infos in WP
Type Specific opcode handlers
• ZEND_ADD(SUB|MUL)
• ZEND_PRE_INC(DEC)
• ZEND_POST_INC(DEC)
• ZEND_IS_(NOT_)EQUAL
• ZEND_IS_SMALLER(_OR_EQUAL)
• ZEND_QM_ASSIGN
• ZEND_SEND_VAR(_EX)
• ZEND_FETCH_DIM_R

And dozens of minor improvements
• More packed array constructions
• Constant propagation based on DFA
• Return type checks eliding
• dozens of minor improvements even I can not recall
Q&A

More Related Content

What's hot (20)

PPTX
Reviewing CPAN modules
neilbowers
 
PPTX
CPAN Exporter modules for Perl 5
neilbowers
 
PDF
Shootout! template engines on the jvm
NLJUG
 
PPTX
Laravel Webcon 2015
Tim Bracken
 
PPTX
Aspect j introduction for non-programmers
Tamas Rev
 
PPTX
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
Roes Wibowo
 
PDF
Laravel - The PHP Framework for Web Artisans
Windzoon Technologies
 
KEY
CakePHP 2.0 - PHP Matsuri 2011
Graham Weldon
 
PDF
2021laravelconftwslides6
LiviaLiaoFontech
 
PPTX
Repeating History...On Purpose...with Elixir
Barry Jones
 
PPTX
Robotframework
Ella Sun
 
PDF
Thymeleaf, will it blend?
Jasha Joachimsthal
 
PPTX
Laravel introduction
Simon Funk
 
PDF
GraphQL-PHP: Dos and don'ts
Václav Šír
 
PDF
Knowing Laravel 5 : The most popular PHP framework
Bukhori Aqid
 
PPTX
Laravel ppt
Mayank Panchal
 
PPT
Php
Ajay Kumar
 
KEY
CakePHP - The Path to 2.0
Graham Weldon
 
PPTX
Introduction to Laravel
Vin Lim
 
PDF
Introduction to Laravel
Eli Wheaton
 
Reviewing CPAN modules
neilbowers
 
CPAN Exporter modules for Perl 5
neilbowers
 
Shootout! template engines on the jvm
NLJUG
 
Laravel Webcon 2015
Tim Bracken
 
Aspect j introduction for non-programmers
Tamas Rev
 
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
Roes Wibowo
 
Laravel - The PHP Framework for Web Artisans
Windzoon Technologies
 
CakePHP 2.0 - PHP Matsuri 2011
Graham Weldon
 
2021laravelconftwslides6
LiviaLiaoFontech
 
Repeating History...On Purpose...with Elixir
Barry Jones
 
Robotframework
Ella Sun
 
Thymeleaf, will it blend?
Jasha Joachimsthal
 
Laravel introduction
Simon Funk
 
GraphQL-PHP: Dos and don'ts
Václav Šír
 
Knowing Laravel 5 : The most popular PHP framework
Bukhori Aqid
 
Laravel ppt
Mayank Panchal
 
CakePHP - The Path to 2.0
Graham Weldon
 
Introduction to Laravel
Vin Lim
 
Introduction to Laravel
Eli Wheaton
 

Viewers also liked (20)

PDF
The secret of PHP7's Performance
Xinchen Hui
 
PDF
微博Lamp性能优化之路(2014)
Xinchen Hui
 
PDF
PHP7 - For Its Best Performance
Xinchen Hui
 
PDF
Php 5.4 performance
Xinchen Hui
 
PDF
PHP7 - The New Engine for old good train
Xinchen Hui
 
PDF
A History of PHP
Xinchen Hui
 
PDF
CreativeUnderworld Workshop
CreativeDon Jaff
 
PDF
Redis vs postgre sql
Toshi Harada
 
PPT
China PHP Technology Summit 2011 ppt
Xinchen Hui
 
PPT
Php performance
Xinchen Hui
 
PDF
Weibo lamp improvements
Xinchen Hui
 
KEY
Mitos do PHP
Augusto Pascutti
 
PDF
Seguranca em PHP @edgarsandi
Edgar Rodrigues Sandi
 
PPTX
PHP tutorial | ptutorial
PTutorial Web
 
PDF
PHP 7 – What changed internally?
Nikita Popov
 
PPT
The Php Life Cycle
Xinchen Hui
 
PDF
Data Types In PHP
Mark Niebergall
 
PPTX
PHP 7 Crash Course - php[world] 2015
Colin O'Dell
 
The secret of PHP7's Performance
Xinchen Hui
 
微博Lamp性能优化之路(2014)
Xinchen Hui
 
PHP7 - For Its Best Performance
Xinchen Hui
 
Php 5.4 performance
Xinchen Hui
 
PHP7 - The New Engine for old good train
Xinchen Hui
 
A History of PHP
Xinchen Hui
 
CreativeUnderworld Workshop
CreativeDon Jaff
 
Redis vs postgre sql
Toshi Harada
 
China PHP Technology Summit 2011 ppt
Xinchen Hui
 
Php performance
Xinchen Hui
 
Weibo lamp improvements
Xinchen Hui
 
Mitos do PHP
Augusto Pascutti
 
Seguranca em PHP @edgarsandi
Edgar Rodrigues Sandi
 
PHP tutorial | ptutorial
PTutorial Web
 
PHP 7 – What changed internally?
Nikita Popov
 
The Php Life Cycle
Xinchen Hui
 
Data Types In PHP
Mark Niebergall
 
PHP 7 Crash Course - php[world] 2015
Colin O'Dell
 
Ad

Similar to PHP7.1 New Features & Performance (20)

PDF
Php7 傳說中的第七隻大象
bobo52310
 
PDF
PHP7: Hello World!
Pavel Nikolov
 
PPTX
Php 7 - YNS
Alex Amistad
 
PPTX
Php 5.6 vs Php 7 performance comparison
Tu Pham
 
PDF
PHP 7X New Features
Thanh Tai
 
PDF
Typed Drupal - A great combination of Drupal 8 and PHP 7
Aditya Ghan
 
PDF
Lesson-5-php BY AAFREEN SHAIKH.pdf HSC INFORMATION TECHNOLOGY CHAP 5 PHP
AAFREEN SHAIKH
 
PDF
Hsc IT 5. Server-Side Scripting (PHP).pdf
AAFREEN SHAIKH
 
PDF
Top ten of PHP 7.4
Andrea Giannantonio
 
PPTX
Migrating to PHP 7
John Coggeshall
 
PDF
Materi Dasar PHP
Robby Firmansyah
 
PDF
What To Expect From PHP7
Codemotion
 
PPTX
php basic part one
jeweltutin
 
PDF
Php tutorial from_beginner_to_master
PrinceGuru MS
 
PDF
Preparing code for Php 7 workshop
Damien Seguy
 
PDF
TAKING PHP SERIOUSLY - Keith Adams
Hermes Alves
 
PPTX
JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro...
Jorge Hidalgo
 
PPTX
Server Scripting Language -PHP
Deo Shao
 
PDF
Module-4_WTA_PHP Class & Error Handling
SIVAKUMAR V
 
PDF
The why and how of moving to php 8
Wim Godden
 
Php7 傳說中的第七隻大象
bobo52310
 
PHP7: Hello World!
Pavel Nikolov
 
Php 7 - YNS
Alex Amistad
 
Php 5.6 vs Php 7 performance comparison
Tu Pham
 
PHP 7X New Features
Thanh Tai
 
Typed Drupal - A great combination of Drupal 8 and PHP 7
Aditya Ghan
 
Lesson-5-php BY AAFREEN SHAIKH.pdf HSC INFORMATION TECHNOLOGY CHAP 5 PHP
AAFREEN SHAIKH
 
Hsc IT 5. Server-Side Scripting (PHP).pdf
AAFREEN SHAIKH
 
Top ten of PHP 7.4
Andrea Giannantonio
 
Migrating to PHP 7
John Coggeshall
 
Materi Dasar PHP
Robby Firmansyah
 
What To Expect From PHP7
Codemotion
 
php basic part one
jeweltutin
 
Php tutorial from_beginner_to_master
PrinceGuru MS
 
Preparing code for Php 7 workshop
Damien Seguy
 
TAKING PHP SERIOUSLY - Keith Adams
Hermes Alves
 
JavaOne 2014 - CON2013 - Code Generation in the Java Compiler: Annotation Pro...
Jorge Hidalgo
 
Server Scripting Language -PHP
Deo Shao
 
Module-4_WTA_PHP Class & Error Handling
SIVAKUMAR V
 
The why and how of moving to php 8
Wim Godden
 
Ad

Recently uploaded (20)

PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
The Future of Artificial Intelligence (AI)
Mukul
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 

PHP7.1 New Features & Performance

  • 1. PHP7.1 New Features & Performance @Laruence
  • 2. About Me • Author of Yaf, Yar, Yac, Yaconf, Taint, Lua, etc • Maintainer of APC, Zend Opcache, Msgpack • PHP core developer since 2011 • Zend consultant since 2013 • Core author of PHP7 • Chief Architect at Lianjia
  • 3. PHP • 20 years history • Most popular Web service program language • Over 82% sites are use PHP as server side program language • Latest version is PHP-7.1
  • 4. PHP71 • Nullable types • Void return type • Iterable pseudo-type • Class constant visibility modifiers • Specify keys in list() • Square bracket syntax for list() • Catching multiple exception types • Missing arguments Excetpion • Warn about invalid strings in arithmetic • Generalize support of negative string offsets • ….
  • 5. Nullable types • An enhancement for typehints return type parameters
  • 6. Void return types • An enhancement for return type hint
  • 7. Iterable Pseudo type • Iterable accepts any array or object implementing Traversable • Iterable can also be used in return type
  • 8. Class constant visibility modifiers • Support class constant visibility
  • 9. Specify keys in list() • An enhancement for list() • Also works in foreach specify keys in list specify keys in list with foreach
  • 10. Square backtrace for list() • Continuation syntax for short array syntax introduced in 5.4 • Also works in foreach too
  • 11. Catching multiply exception types • Allow catching multiply exception types in single catch normal way PHP71 way
  • 12. Missing arguments exception • Disable calling “user” functions with insufficient actual parameters before 71 after 71
  • 13. Warn about invalid strings in arithmetic • Produce E_NOTICE or E_WARNING when using invalid numeric strings with arithmetic operators
  • 14. Generalize support of negative string offsets • Support of negative string offsets when it make sense
  • 16. PHP71 Performance • Over 10% Perfromance improvement 0.901 1.022 2.991 3.045 3.102 3.762 5.318 6.527 13.424 0 2 4 6 8 10 12 14 16 PHP-7.1 PHP-7.0 PHP-5.6 PHP-5.5 PHP-5.4 PHP-5.3 PHP-5.2 PHP-5.1 PHP-5.0 bench.php
  • 17. Type specific opcode handlers ZEND_ADD ZEND_ADD_LONG_LONG
  • 18. Type Inference system • Part work of our JIT in 2013 normal branch loop
  • 19. Static Single-Assignment Form • An intermediate representation, variable is assigned exactly once • Explicit use-def chain
  • 20. Type Inference • What’s ? ’s type at ? point • Computed in compiling time
  • 21. Type Specific opcode handler • Use type specific opcode handler if possible
  • 22. Type Inference system • A tedious work • And we can only get ~30% type-infos in WP
  • 23. Type Specific opcode handlers • ZEND_ADD(SUB|MUL) • ZEND_PRE_INC(DEC) • ZEND_POST_INC(DEC) • ZEND_IS_(NOT_)EQUAL • ZEND_IS_SMALLER(_OR_EQUAL) • ZEND_QM_ASSIGN • ZEND_SEND_VAR(_EX) • ZEND_FETCH_DIM_R

  • 24. And dozens of minor improvements • More packed array constructions • Constant propagation based on DFA • Return type checks eliding • dozens of minor improvements even I can not recall
  • 25. Q&A