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
ย 
Modern PHP
Modern PHPModern PHP
Modern PHP
Simon Jones
ย 
Nginx pres
Nginx presNginx pres
Nginx pres
James Fuller
ย 
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

CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
anilsa9823
ย 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
bodapatigopi8531
ย 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
ย 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
ย 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
ย 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
ย 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
ย 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
ย 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
ย 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
ย 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
ย 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
ย 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
ย 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
ย 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
ย 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
ย 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
ย 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
ย 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ย 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
ย 
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
ย 

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