SlideShare a Scribd company logo
1 of 17
Download to read offline
What’s new in PHP 7.1
And why you really shouldn’t be using PHP5 anymore…
PHP Cambridge, 12th December 2016
Simon Jones, Studio 24
PHP 7.1
• Released 1st Dec 2017
• PHP 5.6 end of life 31 Dec 2018
• PHP 5.4 and 5.5 no longer supported
• WordPress now recommends PHP 7 

(though still works on PHP 5.2

which was released over.. Nine. Years. Ago!)
Supported versions of PHP
http://php.net/supported-versions.php
Why PHP 7?
• Current, stable & supported version of PHP
• Stricter, more secure, and faster!
• Twice as fast for most applications
• Reduced memory usage
http://talks.php.net/fluent15#/wpbench
New features
PHP 5.5
password_hash()

Generators

Zend Optimiser+ opcode cache (OPcache)
PHP 5.6
Constant expressions
Variadic functions (...$params)
PHP 7.0
Scalar type, return type declarations
Exception hierarchy
Spaceship operator <=>
PHP 7.1
Class constant visibility

Nullable types, void return type, iterable pseudo-type
Multi catch exception handling
• Removed from PHP..
• mysql_* functions (use PDO)
• mssql_* functions (use PDO)
• ereg_* functions (use preg_*)
• ASP & script style tags 

<% %> 

<script language=“php”> </script>
• foreach no longer changes the internal array pointer
What breaks / changes in PHP 7.0?
• Error exception thrown when invoking user-defined
functions with too few arguments



function hello($name, $age) { }

echo hello("Simon");
• DateTime constructor includes microseconds, 

be careful when comparing:



new DateTime() == new DateTime();
What breaks / changes in PHP 7.1?
Going, going…
• PHP 4 style constructors



class MyClass {

function MyClass() {}

}
• Static calls to non-static methods



class MyClass {

public function print() {}

}

MyClass::print();
Two new features

Error exceptions & type hinting
• Fatal errors throw exceptions. Yay!
• Custom error handlers may no longer work
Changes to error handling
http://php.net/manual/en/language.errors.php7.php
Type hinting
Scalar type hinting

function hello (string $name, int $age) {

echo "Hello $name, you are nearly " . $age + 1;

}
Return types

function hello (string $name, int $age) : string {

return "Hello $name, you are nearly " . $age + 1;

}
Strict typing
By default, PHP will coerce values of the wrong type into
the expected scalar type if possible. 

function hello (string $name, int $age) { 

echo "Hello $name, you are nearly " . $age + 1;

}

This is OK

hello("Simon", "42");
Strict typing
Unless you enable strict mode

declare(strict_types=1);

function hello (string $name, int $age) { 

echo "Hello $name, you are nearly " . $age + 1;

}
This throws a Fatal error exception

hello("Simon", "42");
Type hinting..
PHP 5.0
Class Name

self
PHP 5.1 array
PHP 5.4 callable
PHP 7.0
bool
float
int
string
PHP 7.1
iterable (array or Traversable)

Nullable types, e.g. ?string
void return type
Migration
• Upgrade to PHP5.6
• Then PHP7
• Migration guides:

http://php.net/manual/en/migration56.php

http://php.net/manual/en/migration70.php

http://php.net/manual/en/migration71.php
Thanks!

More Related Content

What's hot

Loops PHP 04
Loops PHP 04Loops PHP 04
Loops PHP 04Spy Seat
 
Php introduction and configuration
Php introduction and configurationPhp introduction and configuration
Php introduction and configurationVijay Kumar Verma
 
BDD style Unit Testing
BDD style Unit TestingBDD style Unit Testing
BDD style Unit TestingWen-Tien Chang
 
Chapter 02 php basic syntax
Chapter 02   php basic syntaxChapter 02   php basic syntax
Chapter 02 php basic syntaxDhani Ahmad
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAdler Hsieh
 
Ruby Basics
Ruby BasicsRuby Basics
Ruby BasicsSHC
 
Php(report)
Php(report)Php(report)
Php(report)Yhannah
 
10 Groovy Little JavaScript Tips
10 Groovy Little JavaScript Tips10 Groovy Little JavaScript Tips
10 Groovy Little JavaScript TipsTroy Miles
 
Coldfusion
ColdfusionColdfusion
ColdfusionRam
 

What's hot (17)

Loops PHP 04
Loops PHP 04Loops PHP 04
Loops PHP 04
 
Introduction to php php++
Introduction to php php++Introduction to php php++
Introduction to php php++
 
Php introduction and configuration
Php introduction and configurationPhp introduction and configuration
Php introduction and configuration
 
PHP
PHPPHP
PHP
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
BDD style Unit Testing
BDD style Unit TestingBDD style Unit Testing
BDD style Unit Testing
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php
PhpPhp
Php
 
Chapter 02 php basic syntax
Chapter 02   php basic syntaxChapter 02   php basic syntax
Chapter 02 php basic syntax
 
Wt unit 5
Wt unit 5Wt unit 5
Wt unit 5
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
 
Ruby Basics
Ruby BasicsRuby Basics
Ruby Basics
 
RubyMotion #jbday
RubyMotion #jbdayRubyMotion #jbday
RubyMotion #jbday
 
Php(report)
Php(report)Php(report)
Php(report)
 
10 Groovy Little JavaScript Tips
10 Groovy Little JavaScript Tips10 Groovy Little JavaScript Tips
10 Groovy Little JavaScript Tips
 
Coldfusion
ColdfusionColdfusion
Coldfusion
 

Viewers also liked (20)

OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)
 
PHP variables
PHP  variablesPHP  variables
PHP variables
 
Speed up your site with Varnish
Speed up your site with VarnishSpeed up your site with Varnish
Speed up your site with Varnish
 
What we look for 
in people when recruiting
What we look for 
in people when recruitingWhat we look for 
in people when recruiting
What we look for 
in people when recruiting
 
Modern PHP
Modern PHPModern PHP
Modern PHP
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Font
FontFont
Font
 
Php variables (english)
Php variables (english)Php variables (english)
Php variables (english)
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
Htmltag.ppt
Htmltag.pptHtmltag.ppt
Htmltag.ppt
 
Php ppt
Php pptPhp ppt
Php ppt
 
Arrays in PHP
Arrays in PHPArrays in PHP
Arrays in PHP
 
Execute MySQL query using command prompt
Execute MySQL query using command promptExecute MySQL query using command prompt
Execute MySQL query using command prompt
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
 
State management
State managementState management
State management
 
Execute sql query or sql command sql server using command prompt
Execute sql query or sql command sql server using command promptExecute sql query or sql command sql server using command prompt
Execute sql query or sql command sql server using command prompt
 
Php forms
Php formsPhp forms
Php forms
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Regular Expressions in PHP
Regular Expressions in PHPRegular Expressions in PHP
Regular Expressions in PHP
 
PHP Summer Training Presentation
PHP Summer Training PresentationPHP Summer Training Presentation
PHP Summer Training Presentation
 

Similar to What's new in PHP 7.1

Similar to What's new in PHP 7.1 (20)

TAKING PHP SERIOUSLY - Keith Adams
TAKING PHP SERIOUSLY - Keith AdamsTAKING PHP SERIOUSLY - Keith Adams
TAKING PHP SERIOUSLY - Keith Adams
 
What To Expect From PHP7
What To Expect From PHP7What To Expect From PHP7
What To Expect From PHP7
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Preparing code for Php 7 workshop
Preparing code for Php 7 workshopPreparing code for Php 7 workshop
Preparing code for Php 7 workshop
 
Php7 傳說中的第七隻大象
Php7 傳說中的第七隻大象Php7 傳說中的第七隻大象
Php7 傳說中的第七隻大象
 
Peek at PHP 7
Peek at PHP 7Peek at PHP 7
Peek at PHP 7
 
Php7 HHVM and co
Php7 HHVM and coPhp7 HHVM and co
Php7 HHVM and co
 
Migrating to PHP 7
Migrating to PHP 7Migrating to PHP 7
Migrating to PHP 7
 
Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13
 
Start using PHP 7
Start using PHP 7Start using PHP 7
Start using PHP 7
 
Php7 hhvm and co
Php7 hhvm and coPhp7 hhvm and co
Php7 hhvm and co
 
The why and how of moving to php 7
The why and how of moving to php 7The why and how of moving to php 7
The why and how of moving to php 7
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
 
01 basics
01 basics01 basics
01 basics
 
php basic
php basicphp basic
php basic
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Prersentation
PrersentationPrersentation
Prersentation
 
50 shades of PHP
50 shades of PHP50 shades of PHP
50 shades of PHP
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

What's new in PHP 7.1

  • 1. What’s new in PHP 7.1 And why you really shouldn’t be using PHP5 anymore… PHP Cambridge, 12th December 2016 Simon Jones, Studio 24
  • 2. PHP 7.1 • Released 1st Dec 2017 • PHP 5.6 end of life 31 Dec 2018 • PHP 5.4 and 5.5 no longer supported • WordPress now recommends PHP 7 
 (though still works on PHP 5.2
 which was released over.. Nine. Years. Ago!)
  • 3. Supported versions of PHP http://php.net/supported-versions.php
  • 4. Why PHP 7? • Current, stable & supported version of PHP • Stricter, more secure, and faster! • Twice as fast for most applications • Reduced memory usage
  • 6. New features PHP 5.5 password_hash()
 Generators
 Zend Optimiser+ opcode cache (OPcache) PHP 5.6 Constant expressions Variadic functions (...$params) PHP 7.0 Scalar type, return type declarations Exception hierarchy Spaceship operator <=> PHP 7.1 Class constant visibility
 Nullable types, void return type, iterable pseudo-type Multi catch exception handling
  • 7. • Removed from PHP.. • mysql_* functions (use PDO) • mssql_* functions (use PDO) • ereg_* functions (use preg_*) • ASP & script style tags 
 <% %> 
 <script language=“php”> </script> • foreach no longer changes the internal array pointer What breaks / changes in PHP 7.0?
  • 8. • Error exception thrown when invoking user-defined functions with too few arguments
 
 function hello($name, $age) { }
 echo hello("Simon"); • DateTime constructor includes microseconds, 
 be careful when comparing:
 
 new DateTime() == new DateTime(); What breaks / changes in PHP 7.1?
  • 9. Going, going… • PHP 4 style constructors
 
 class MyClass {
 function MyClass() {}
 } • Static calls to non-static methods
 
 class MyClass {
 public function print() {}
 }
 MyClass::print();
  • 10. Two new features
 Error exceptions & type hinting
  • 11. • Fatal errors throw exceptions. Yay! • Custom error handlers may no longer work Changes to error handling http://php.net/manual/en/language.errors.php7.php
  • 12. Type hinting Scalar type hinting
 function hello (string $name, int $age) {
 echo "Hello $name, you are nearly " . $age + 1;
 } Return types
 function hello (string $name, int $age) : string {
 return "Hello $name, you are nearly " . $age + 1;
 }
  • 13. Strict typing By default, PHP will coerce values of the wrong type into the expected scalar type if possible. 
 function hello (string $name, int $age) { 
 echo "Hello $name, you are nearly " . $age + 1;
 }
 This is OK
 hello("Simon", "42");
  • 14. Strict typing Unless you enable strict mode
 declare(strict_types=1);
 function hello (string $name, int $age) { 
 echo "Hello $name, you are nearly " . $age + 1;
 } This throws a Fatal error exception
 hello("Simon", "42");
  • 15. Type hinting.. PHP 5.0 Class Name
 self PHP 5.1 array PHP 5.4 callable PHP 7.0 bool float int string PHP 7.1 iterable (array or Traversable)
 Nullable types, e.g. ?string void return type
  • 16. Migration • Upgrade to PHP5.6 • Then PHP7 • Migration guides:
 http://php.net/manual/en/migration56.php
 http://php.net/manual/en/migration70.php
 http://php.net/manual/en/migration71.php