SlideShare a Scribd company logo
1 of 28
PHP 5.6: New and
Deprecated Features
Mark Niebergall
https://joind.in/13884
About Mark Niebergall
● Developing in PHP since 2005
● Masters degree in Information Systems
● Senior Software Engineer and Team Lead
● Occupational health screening project
● Security: SSCP, CSSLP Certified
● PHP, databases, JavaScript
● Enjoy being outdoors
Supported Versions
See http://php.net/supported-versions.php
State of PHP
● PHP 5.3.29 EOL for PHP 5.3 release August 14, 2014
● PHP 5.4.40 released April 16, 2015, aging but still heavily used
● PHP 5.5.24 is current, many servers running PHP 5.5.X
● PHP 5.6.8 released April 16, 2015
● PHP 5.6.0 available since August 28, 2014
● PHP 5.7 is under development
● PHP 7.0 is under development
o PHP 6 unicode, branched but will never have production release
o Vote for version 6 vs 7, decided on 7
o Focused on performance
o More compact data structures - easier for JIT compiler
o Improved variable syntax (see
https://wiki.php.net/rfc/uniform_variable_syntax)
Live Demo
Setup
● 2 vagrant virtual machines with puppet
o 1 with PHP 5.5.8
o 1 with PHP 5.6.0
o Automatic code sync so same code resides on both web servers
See https://qa.php.net/howtohelp.php
PHP 5.6 Incompatible
Out With The Old
● Array keys won't be overwritten when defining an array as a property of a
class via an array literal
Source: http://us1.php.net/manual/en/migration56.incompatible.php
PHP 5.6 Incompatible
Out With The Old
● json_decode strictness
● Stream wrappers now verify peer certificates and host names by default
when using SSL/TLS
● GMP (GNU Multiple Precision Arithmetic Library) resources are now
objects
● Mcrypt functions now require valid keys and initialization vectors
Source: http://us1.php.net/manual/en/migration56.incompatible.php
PHP 5.6 Deprecated
On the way Out
● Calling a method from an incompatible context
PHP 5.6 Deprecated
On the way Out
● $HTTP_RAW_POST_DATA and always_populate_raw_post_data
o use php://input instead (file_get_contents('php://input'))
o php://input is now reusable
Source: http://us1.php.net/manual/en/migration56.deprecated.php
PHP 5.6 Deprecated
On the way Out
● iconv and mbstring encoding settings
o default_charset with UTF-8 as default value
o iconv.input_encoding, iconv.output_encoding, iconv.internal_encoding
o mbstring.http_input, mbstring.http_output, mbstring.internal_encoding
Source: http://us1.php.net/manual/en/migration56.deprecated.php
PHP 5.6 Changed
Changed functionality
● crypt() will now raise an E_NOTICE error if no salt parameter
PHP 5.6 Changed
Changed functionality
● substr_compare() will now accept 0 for its length parameter
PHP 5.6 Changed
Changed functionality
● unserialize() will now fail if passed serialized data that has been
manipulated to attempt to instantiate an object without calling its
constructor
● cURL @file vs CURLFile
● Mcrypt source default value for mcrypt_create_iv
● PostgreSQL functions no longer experimental (ex: pg_insert)
● PostgreSQL pg_send_* no longer block until query write completion
● ReflectionClass::newInstanceWithoutConstructor() now allows non-final
internal classes to be instantiated
● XMLReader::getAttributeNs() and XMLReader::getAttributeNo() now return
NULL if the attribute could not be found, like XMLReader::getAttribute()
Source: http://us1.php.net/manual/en/migration56.changed-functions.php
PHP 5.6 New Functions
New functions
● GMP: gmp_root(), gmp_rootrem()
● LDAP: ldap_escape(), ldap_modify_batch()
● MySQLi: mysqli_get_links_stats()
● OCI8: oci_get_implicit_resultset()
● OpenSSL: openssl_get_cert_locations(), openssl_x509_fingerprint(),
openssl_spki_new(), openssl_spki_verify(),
openssl_spki_export_challenge(), openssl_spki_export()
Source: http://us1.php.net/manual/en/migration56.new-functions.php
PHP 5.6 New Functions
New functions (continued)
● PostgreSQL: pg_connect_poll(), pg_consume_input(), pg_flush(),
pg_socket()
● PDO_PGSQL: PDO::pgsqlGetNotify(), PDO::pgsqlGetPid()
● Zip: ZipArchive::setPassword()
Source: http://us1.php.net/manual/en/migration56.new-functions.php
PHP 5.6 New Features
New stuff
● Constant scalar expressions
PHP 5.6 New Features
New stuff
● Variadic functions
PHP 5.6 New Features
New stuff
● Argument unpacking using …
● AKA Splat
PHP 5.6 New Features
New stuff
● Exponentiation via **
PHP 5.6 New Features
New stuff
● use const and use function
PHP 5.6 New Features
New stuff
● Upload file > 2GB
o Sorry, not going to show this one
PHP 5.6 New Features
New stuff
● GMP now supports operator overloading
PHP 5.6 New Features
New stuff
● hash_equals: Timing attack safe string comparison
PHP 5.6 New Features
New stuff
● Magic method __debugInfo: Define
output for var_dump of class
Testing PHP builds
PHP QA
● Testing overview at https://qa.php.net/
● Test a build
o wget http://downloads.php.net/tyrael/php-5.6.9RC1.tar.gz
o tar xvzf php-5.6.9RC1.tar.gz
o cd php-5.6.9RC1
o ./configure
o make test
● Write testcases
● Give PHP QA team server time
See https://qa.php.net/howtohelp.php
Testing PHP builds
PHP QA
Testing PHP builds
PHP QA
Questions?
● https://joind.in/13884

More Related Content

What's hot

Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
julien pauli
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
Xinchen Hui
 
PHP traits, treat or threat?
PHP traits, treat or threat?PHP traits, treat or threat?
PHP traits, treat or threat?
Nick Belhomme
 

What's hot (20)

2021.laravelconf.tw.slides2
2021.laravelconf.tw.slides22021.laravelconf.tw.slides2
2021.laravelconf.tw.slides2
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015
 
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesPHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return Types
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5
 
Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
 
How PHP Works ?
How PHP Works ?How PHP Works ?
How PHP Works ?
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
 
30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPAN
 
PHP7 is coming
PHP7 is comingPHP7 is coming
PHP7 is coming
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
 
Profiling php5 to php7
Profiling php5 to php7Profiling php5 to php7
Profiling php5 to php7
 
When e-commerce meets Symfony
When e-commerce meets SymfonyWhen e-commerce meets Symfony
When e-commerce meets Symfony
 
Modern PHP
Modern PHPModern PHP
Modern PHP
 
PHP, Under The Hood - DPC
PHP, Under The Hood - DPCPHP, Under The Hood - DPC
PHP, Under The Hood - DPC
 
PHP7 Presentation
PHP7 PresentationPHP7 Presentation
PHP7 Presentation
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshop
 
Nginx pres
Nginx presNginx pres
Nginx pres
 
php
phpphp
php
 
PHP traits, treat or threat?
PHP traits, treat or threat?PHP traits, treat or threat?
PHP traits, treat or threat?
 

Similar to PHP 5.6 New and Deprecated Features

これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
goccy
 

Similar to PHP 5.6 New and Deprecated Features (20)

Php 5.6 vs Php 7 performance comparison
Php 5.6 vs Php 7 performance comparisonPhp 5.6 vs Php 7 performance comparison
Php 5.6 vs Php 7 performance comparison
 
PHP 7X New Features
PHP 7X New FeaturesPHP 7X New Features
PHP 7X New Features
 
Php 5.6 From the Inside Out
Php 5.6 From the Inside OutPhp 5.6 From the Inside Out
Php 5.6 From the Inside Out
 
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
 
Last Month in PHP - February 2017
Last Month in PHP - February 2017Last Month in PHP - February 2017
Last Month in PHP - February 2017
 
Php
PhpPhp
Php
 
BSA Academy 2016. PHP 7. What's new?
BSA Academy 2016. PHP 7. What's new?BSA Academy 2016. PHP 7. What's new?
BSA Academy 2016. PHP 7. What's new?
 
LSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginxLSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginx
 
PHP Development Tools
PHP  Development ToolsPHP  Development Tools
PHP Development Tools
 
Last Month in PHP - June 2016
Last Month in PHP - June 2016Last Month in PHP - June 2016
Last Month in PHP - June 2016
 
Php 7 - YNS
Php 7 - YNSPhp 7 - YNS
Php 7 - YNS
 
Php
PhpPhp
Php
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
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
 
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
 
A brief to PHP 7.3
A brief to PHP 7.3A brief to PHP 7.3
A brief to PHP 7.3
 
IPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHopIPC 2013 - High Performance PHP with HipHop
IPC 2013 - High Performance PHP with HipHop
 
Preparing code for Php 7 workshop
Preparing code for Php 7 workshopPreparing code for Php 7 workshop
Preparing code for Php 7 workshop
 
Last Month in PHP - October 2016
Last Month in PHP - October 2016Last Month in PHP - October 2016
Last Month in PHP - October 2016
 
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
 

More from Mark Niebergall

More from Mark Niebergall (20)

Filesystem Management with Flysystem - php[tek] 2023
Filesystem Management with Flysystem - php[tek] 2023Filesystem Management with Flysystem - php[tek] 2023
Filesystem Management with Flysystem - php[tek] 2023
 
Leveling Up With Unit Testing - php[tek] 2023
Leveling Up With Unit Testing - php[tek] 2023Leveling Up With Unit Testing - php[tek] 2023
Leveling Up With Unit Testing - php[tek] 2023
 
Filesystem Management with Flysystem at PHP UK 2023
Filesystem Management with Flysystem at PHP UK 2023Filesystem Management with Flysystem at PHP UK 2023
Filesystem Management with Flysystem at PHP UK 2023
 
Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022Leveling Up With Unit Testing - LonghornPHP 2022
Leveling Up With Unit Testing - LonghornPHP 2022
 
Developing SOLID Code
Developing SOLID CodeDeveloping SOLID Code
Developing SOLID Code
 
Unit Testing from Setup to Deployment
Unit Testing from Setup to DeploymentUnit Testing from Setup to Deployment
Unit Testing from Setup to Deployment
 
Stacking Up Middleware
Stacking Up MiddlewareStacking Up Middleware
Stacking Up Middleware
 
BDD API Tests with Gherkin and Behat
BDD API Tests with Gherkin and BehatBDD API Tests with Gherkin and Behat
BDD API Tests with Gherkin and Behat
 
BDD API Tests with Gherkin and Behat
BDD API Tests with Gherkin and BehatBDD API Tests with Gherkin and Behat
BDD API Tests with Gherkin and Behat
 
Hacking with PHP
Hacking with PHPHacking with PHP
Hacking with PHP
 
Relational Database Design Bootcamp
Relational Database Design BootcampRelational Database Design Bootcamp
Relational Database Design Bootcamp
 
Starting Out With PHP
Starting Out With PHPStarting Out With PHP
Starting Out With PHP
 
Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)
Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)
Automatic PHP 7 Compatibility Checking Using php7cc (and PHPCompatibility)
 
Debugging PHP with Xdebug - PHPUK 2018
Debugging PHP with Xdebug - PHPUK 2018Debugging PHP with Xdebug - PHPUK 2018
Debugging PHP with Xdebug - PHPUK 2018
 
Advanced PHP Simplified - Sunshine PHP 2018
Advanced PHP Simplified - Sunshine PHP 2018Advanced PHP Simplified - Sunshine PHP 2018
Advanced PHP Simplified - Sunshine PHP 2018
 
Defensive Coding Crash Course Tutorial
Defensive Coding Crash Course TutorialDefensive Coding Crash Course Tutorial
Defensive Coding Crash Course Tutorial
 
Inheritance: Vertical or Horizontal
Inheritance: Vertical or HorizontalInheritance: Vertical or Horizontal
Inheritance: Vertical or Horizontal
 
Cybersecurity State of the Union
Cybersecurity State of the UnionCybersecurity State of the Union
Cybersecurity State of the Union
 
Cryptography With PHP - ZendCon 2017 Workshop
Cryptography With PHP - ZendCon 2017 WorkshopCryptography With PHP - ZendCon 2017 Workshop
Cryptography With PHP - ZendCon 2017 Workshop
 
Defensive Coding Crash Course - ZendCon 2017
Defensive Coding Crash Course - ZendCon 2017Defensive Coding Crash Course - ZendCon 2017
Defensive Coding Crash Course - ZendCon 2017
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 

PHP 5.6 New and Deprecated Features

  • 1. PHP 5.6: New and Deprecated Features Mark Niebergall https://joind.in/13884
  • 2. About Mark Niebergall ● Developing in PHP since 2005 ● Masters degree in Information Systems ● Senior Software Engineer and Team Lead ● Occupational health screening project ● Security: SSCP, CSSLP Certified ● PHP, databases, JavaScript ● Enjoy being outdoors
  • 4. State of PHP ● PHP 5.3.29 EOL for PHP 5.3 release August 14, 2014 ● PHP 5.4.40 released April 16, 2015, aging but still heavily used ● PHP 5.5.24 is current, many servers running PHP 5.5.X ● PHP 5.6.8 released April 16, 2015 ● PHP 5.6.0 available since August 28, 2014 ● PHP 5.7 is under development ● PHP 7.0 is under development o PHP 6 unicode, branched but will never have production release o Vote for version 6 vs 7, decided on 7 o Focused on performance o More compact data structures - easier for JIT compiler o Improved variable syntax (see https://wiki.php.net/rfc/uniform_variable_syntax)
  • 5. Live Demo Setup ● 2 vagrant virtual machines with puppet o 1 with PHP 5.5.8 o 1 with PHP 5.6.0 o Automatic code sync so same code resides on both web servers See https://qa.php.net/howtohelp.php
  • 6. PHP 5.6 Incompatible Out With The Old ● Array keys won't be overwritten when defining an array as a property of a class via an array literal Source: http://us1.php.net/manual/en/migration56.incompatible.php
  • 7. PHP 5.6 Incompatible Out With The Old ● json_decode strictness ● Stream wrappers now verify peer certificates and host names by default when using SSL/TLS ● GMP (GNU Multiple Precision Arithmetic Library) resources are now objects ● Mcrypt functions now require valid keys and initialization vectors Source: http://us1.php.net/manual/en/migration56.incompatible.php
  • 8. PHP 5.6 Deprecated On the way Out ● Calling a method from an incompatible context
  • 9. PHP 5.6 Deprecated On the way Out ● $HTTP_RAW_POST_DATA and always_populate_raw_post_data o use php://input instead (file_get_contents('php://input')) o php://input is now reusable Source: http://us1.php.net/manual/en/migration56.deprecated.php
  • 10. PHP 5.6 Deprecated On the way Out ● iconv and mbstring encoding settings o default_charset with UTF-8 as default value o iconv.input_encoding, iconv.output_encoding, iconv.internal_encoding o mbstring.http_input, mbstring.http_output, mbstring.internal_encoding Source: http://us1.php.net/manual/en/migration56.deprecated.php
  • 11. PHP 5.6 Changed Changed functionality ● crypt() will now raise an E_NOTICE error if no salt parameter
  • 12. PHP 5.6 Changed Changed functionality ● substr_compare() will now accept 0 for its length parameter
  • 13. PHP 5.6 Changed Changed functionality ● unserialize() will now fail if passed serialized data that has been manipulated to attempt to instantiate an object without calling its constructor ● cURL @file vs CURLFile ● Mcrypt source default value for mcrypt_create_iv ● PostgreSQL functions no longer experimental (ex: pg_insert) ● PostgreSQL pg_send_* no longer block until query write completion ● ReflectionClass::newInstanceWithoutConstructor() now allows non-final internal classes to be instantiated ● XMLReader::getAttributeNs() and XMLReader::getAttributeNo() now return NULL if the attribute could not be found, like XMLReader::getAttribute() Source: http://us1.php.net/manual/en/migration56.changed-functions.php
  • 14. PHP 5.6 New Functions New functions ● GMP: gmp_root(), gmp_rootrem() ● LDAP: ldap_escape(), ldap_modify_batch() ● MySQLi: mysqli_get_links_stats() ● OCI8: oci_get_implicit_resultset() ● OpenSSL: openssl_get_cert_locations(), openssl_x509_fingerprint(), openssl_spki_new(), openssl_spki_verify(), openssl_spki_export_challenge(), openssl_spki_export() Source: http://us1.php.net/manual/en/migration56.new-functions.php
  • 15. PHP 5.6 New Functions New functions (continued) ● PostgreSQL: pg_connect_poll(), pg_consume_input(), pg_flush(), pg_socket() ● PDO_PGSQL: PDO::pgsqlGetNotify(), PDO::pgsqlGetPid() ● Zip: ZipArchive::setPassword() Source: http://us1.php.net/manual/en/migration56.new-functions.php
  • 16. PHP 5.6 New Features New stuff ● Constant scalar expressions
  • 17. PHP 5.6 New Features New stuff ● Variadic functions
  • 18. PHP 5.6 New Features New stuff ● Argument unpacking using … ● AKA Splat
  • 19. PHP 5.6 New Features New stuff ● Exponentiation via **
  • 20. PHP 5.6 New Features New stuff ● use const and use function
  • 21. PHP 5.6 New Features New stuff ● Upload file > 2GB o Sorry, not going to show this one
  • 22. PHP 5.6 New Features New stuff ● GMP now supports operator overloading
  • 23. PHP 5.6 New Features New stuff ● hash_equals: Timing attack safe string comparison
  • 24. PHP 5.6 New Features New stuff ● Magic method __debugInfo: Define output for var_dump of class
  • 25. Testing PHP builds PHP QA ● Testing overview at https://qa.php.net/ ● Test a build o wget http://downloads.php.net/tyrael/php-5.6.9RC1.tar.gz o tar xvzf php-5.6.9RC1.tar.gz o cd php-5.6.9RC1 o ./configure o make test ● Write testcases ● Give PHP QA team server time See https://qa.php.net/howtohelp.php