SlideShare a Scribd company logo
1 of 30
Download to read offline
PHP 5.6 
From The Inside Out
Introduction 
● Ferenc Kovacs 
○ DevOps guy from Budapest, Hungary 
○ Infrastructure Engineer at http://www.ustream.tv/ 
○ Volunteer for the PHP project since 2011 
○ Release Manager for PHP 5.6 with Julien Pauli
History of PHP 5.6 
● 2012-11-09: First commit 
● 2013-11-06: PHP-5.6 branched out 
● 2014-01-23: PHP-5.6.0alpha1(rfc freeze) 
● 2014-04-11: PHP-5.6.0beta1(feature freeze) 
● 2014-06-19: PHP-5.6.0RC1 
● 2014-08-28: PHP-5.6.0
Some stats about the changes 
Version Released Commits Authors LOC added LOC deleted 
5.3.0 2009-06-30 5339 83 1575768 756904 
5.4.0 2012-03-01 18779 135 3701590 2150397 
5.5.0 2013-06-20 2842 113 287785 164481 
5.6.0 2014-08-28 2013 107 496200 1235336 
7.0 N/A 3671 90 531825 1315925
Release Process 
https://wiki.php.net/rfc/releaseprocess 
tl;dr: 
● yearly release schedule(timeboxing), 2+1 
year support cycle. 
● guidelines about what is allowed in a 
major/minor/micro version. 
● resulting smaller, more predictable releases 
which are easier to upgrade to.
Changes in 5.6 
1. BC breaks 
2. New features 
3. Deprecated features
BC breaks 
● json_decode() only accepts lowercase for 
true/false/null to follow the JSON spec. 
● Stream wrappers now verify peer certificates 
and host names by default when using 
SSL/TLS. 
● GMP resources are now objects. 
● Mcrypt functions now require valid keys and 
IVs.
BC breaks 
● unserialize() now validates the serialize 
format for classes implementing Serializable. 
○ class Foo 
■ O:3:"Foo":0:{} 
○ class Foo implements Serializable 
■ C:3:"Foo":4:{r:1;} 
○ Can be a problem if you handcrafting the strings 
(PHPUnit, Doctrine) or storing those somewhere and 
the class definition changes(Horde).
BC breaks 
● using the @file syntax for curl file uploads 
are only supported if option 
CURLOPT_SAFE_UPLOAD is set to false. 
CURLFile should be used instead.
BC breaks 
<?php 
class C { 
const ONE = 1; 
public $array = [ 
self::ONE => 'foo', 
'bar', 
'quux', 
]; 
} 
count((new C)->array); // 2 on <=5.5 but 3 on >=5.6 
?>
New features 
The big ones 
● Constant scalar expressions 
● Variadic functions 
● Argument unpacking 
● Power operator 
● use function and use const 
● phpdbg 
● SSL/TLS improvements
Constant scalar expressions 
<?php 
const ONE = 1; 
const TWO = ONE * 2; 
class C { 
const THREE = TWO + 1; 
const ONE_THIRD = ONE / self::THREE; 
const SENTENCE = 'The value of THREE is '.self::THREE; 
public function f($a = ONE + self::THREE) { 
return $a; 
} 
} 
echo (new C)->f()."n"; // 4 
echo C::SENTENCE; // The value of THREE is 3 
?>
Variadic functions 
<?php 
function f($req, $opt = null, ...$params) { 
// $params is an array containing the remaining arguments. 
printf('$req: %d; $opt: %d; number of params: %d'."n", 
$req, $opt, count($params)); 
} 
f(1); // $req: 1; $opt: 0; number of params: 0 
f(1, 2); // $req: 1; $opt: 2; number of params: 0 
f(1, 2, 3); // $req: 1; $opt: 2; number of params: 1 
f(1, 2, 3, 4); // $req: 1; $opt: 2; number of params: 2 
f(1, 2, 3, 4, 5); // $req: 1; $opt: 2; number of params: 3 
?>
Argument Unpacking 
<?php 
function add($a, $b, $c) { 
return $a + $b + $c; 
} 
$operators = [2, 3]; 
echo add(1, ...$operators); // 6 
?>
Power operator 
<?php 
printf("2 ** 3 == %dn", 2 ** 3); // 2** 3 == 8 
printf("2 ** 3 ** 2 == %dn", 2 ** 3 ** 2); // 2 ** 3 ** 2 == 512 
$a = 2; 
$a **= 3; 
printf("a == %dn", $a); // a == 8 
?>
use function and use const 
<?php 
namespace NameSpace { 
const FOO = 42; 
function f() { echo __FUNCTION__."n"; } 
} 
namespace { 
use const NameSpaceFOO; 
use function NameSpacef; 
echo FOO."n"; // 42 
f(); // NameSpacef 
} 
?>
phpdbg 
New SAPI for debugging php scripts 
● really handy for debugging cli scripts or 
debugging without an IDE. 
● no out-of-the-box solution for debugging web 
requests(WIP). 
● no IDE integration yet(WIP). 
● those familiar with gdb will probably like it.
phpdbg features 
● list source for line/function/method/class 
● show info about current 
files/classes/functions/etc. 
● print opcodes for classes/functions/current 
execution context, etc. 
● traverse and sho information about 
stackframes
phpdbg features 
● show the current backtrace. 
● set execution context. 
● run the current execution context. 
● step through the execution. 
● continue the execution until the next 
breakpoint/watchpoint. 
● continue the execution until the next 
breakpoint/watchpoint after the given line.
phpdbg features 
● continue the execution skipping any 
breakpoint/watchpoint until the current frame 
is finished. 
● continue the execution skipping any 
breakpoint/watchpoint to right before we 
leave the current frame.
phpdbg features 
● set a conditional expression on the target 
where execution will break if the expression 
evaluates true. 
● set a watchpoint on variable. 
● clear breakpoints. 
● clean up the execution environment(remove 
constant/function/class definitions).
phpdbg features 
● set the phpdbg configuration. 
● source a phpdbginit script. 
● register a phpdbginit function as an alias. 
● shell a command. 
● evaluate some code. 
● quit.
SSL/TLS improvements 
● Stream wrappers now verify peer certificates 
and host names by default when using 
SSL/TLS. 
● Added support SAN x509 extension 
matching for verifying host names in 
encrypted streams. 
● New SSL context options for improved 
stream server security.
SSL/TLS improvements 
● Added support for Server Name Indication. 
● Added protocol-specific encryption stream 
wrappers (tlsv1.0://, tlsv1.1:// and tlsv1.2://). 
● Added support for managing SPKAC/SPKI.
Other features 
● __debugInfo() magic method for intercepting 
var_dump(); 
● php://input is reusable 
● Large file uploads (>2GB) are now accepted. 
● The new GMP objects now support operator 
overloading. 
● hash_equals() for constant time string 
comparison.
Other features 
● gost-crypto hash algo was added. 
● PostgreSQL async support 
○ pg_connect($dsn, PGSQL_CONNECT_ASYNC); 
○ pg_connect_poll(); 
○ pg_socket(); 
○ pg_consume_input(); 
○ pg_flush(); 
● ReflectionClass:: 
newInstanceWithoutConstructor() can 
instantiate almost everything.
Other features 
● The default value for default_charset 
changed to UTF-8, html* iconv* and 
mbstring* function will use this value when 
no explicit encoding is set/passed. 
● New fetching mode for mysqlnd, controlled 
via mysqlnd.fetch_data_copy. 
○ Will use less memory but do more copying.
Deprecated features 
● Calls from incompatible context will now emit 
E_DEPRECATED instead of E_STRICT 
● always_populate_raw_post_data now have 
a new value(-1), which completely disables 
the population of 
$HTTP_RAW_POST_DATA, setting it 
anything else will emit an E_DEPRECATED.
Deprecated features 
● The following settings are all deprecated in 
favor of default_charset: 
○ iconv.input_encoding 
○ iconv.output_encoding 
○ iconv.internal_encoding 
○ mbstring.http_input 
○ mbstring.http_output 
○ mbstring.internal_encoding
Thanks for your attention! 
Slides will be here: 
http://www.slideshare.net/Tyrael 
If you have any questions: 
tyrael@php.net 
@Tyr43l

More Related Content

What's hot

Advanced Replication Internals
Advanced Replication InternalsAdvanced Replication Internals
Advanced Replication InternalsScott Hernandez
 
Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programsBadoo Development
 
A new way to develop with WordPress!
A new way to develop with WordPress!A new way to develop with WordPress!
A new way to develop with WordPress!David Sanchez
 
OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2Pradeep Kumar TS
 
Getting by with just psql
Getting by with just psqlGetting by with just psql
Getting by with just psqlCorey Huinker
 
Etl confessions pg conf us 2017
Etl confessions   pg conf us 2017Etl confessions   pg conf us 2017
Etl confessions pg conf us 2017Corey Huinker
 
3. writing MySql plugins for the information schema
3. writing MySql plugins for the information schema3. writing MySql plugins for the information schema
3. writing MySql plugins for the information schemaRoland Bouman
 
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 comparisonTu Pham
 
PHP 7X New Features
PHP 7X New FeaturesPHP 7X New Features
PHP 7X New FeaturesThanh Tai
 
Optimizing mysql stored routines uc2010
Optimizing mysql stored routines uc2010Optimizing mysql stored routines uc2010
Optimizing mysql stored routines uc2010Roland Bouman
 
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesPHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesEric Poe
 
MongoDB 2.8 Replication Internals: Fitting it all together
MongoDB 2.8 Replication Internals: Fitting it all togetherMongoDB 2.8 Replication Internals: Fitting it all together
MongoDB 2.8 Replication Internals: Fitting it all togetherScott Hernandez
 
HKG15-211: Advanced Toolchain Usage Part 4
HKG15-211: Advanced Toolchain Usage Part 4HKG15-211: Advanced Toolchain Usage Part 4
HKG15-211: Advanced Toolchain Usage Part 4Linaro
 
The Ring programming language version 1.5.4 book - Part 78 of 185
The Ring programming language version 1.5.4 book - Part 78 of 185The Ring programming language version 1.5.4 book - Part 78 of 185
The Ring programming language version 1.5.4 book - Part 78 of 185Mahmoud Samir Fayed
 
Runtime Symbol Resolution
Runtime Symbol ResolutionRuntime Symbol Resolution
Runtime Symbol ResolutionKen Kawamoto
 

What's hot (20)

Advanced Replication Internals
Advanced Replication InternalsAdvanced Replication Internals
Advanced Replication Internals
 
Oracle RDBMS Workshop (Part1)
Oracle RDBMS Workshop (Part1)Oracle RDBMS Workshop (Part1)
Oracle RDBMS Workshop (Part1)
 
Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programs
 
A new way to develop with WordPress!
A new way to develop with WordPress!A new way to develop with WordPress!
A new way to develop with WordPress!
 
OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2
 
Getting by with just psql
Getting by with just psqlGetting by with just psql
Getting by with just psql
 
Ruby meetup ROM
Ruby meetup ROMRuby meetup ROM
Ruby meetup ROM
 
Etl confessions pg conf us 2017
Etl confessions   pg conf us 2017Etl confessions   pg conf us 2017
Etl confessions pg conf us 2017
 
3. writing MySql plugins for the information schema
3. writing MySql plugins for the information schema3. writing MySql plugins for the information schema
3. writing MySql plugins for the information schema
 
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
 
SVN Hook
SVN HookSVN Hook
SVN Hook
 
PHP 7X New Features
PHP 7X New FeaturesPHP 7X New Features
PHP 7X New Features
 
Optimizing mysql stored routines uc2010
Optimizing mysql stored routines uc2010Optimizing mysql stored routines uc2010
Optimizing mysql stored routines uc2010
 
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesPHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return Types
 
Clojure+ClojureScript Webapps
Clojure+ClojureScript WebappsClojure+ClojureScript Webapps
Clojure+ClojureScript Webapps
 
MongoDB 2.8 Replication Internals: Fitting it all together
MongoDB 2.8 Replication Internals: Fitting it all togetherMongoDB 2.8 Replication Internals: Fitting it all together
MongoDB 2.8 Replication Internals: Fitting it all together
 
HKG15-211: Advanced Toolchain Usage Part 4
HKG15-211: Advanced Toolchain Usage Part 4HKG15-211: Advanced Toolchain Usage Part 4
HKG15-211: Advanced Toolchain Usage Part 4
 
Using zone.js
Using zone.jsUsing zone.js
Using zone.js
 
The Ring programming language version 1.5.4 book - Part 78 of 185
The Ring programming language version 1.5.4 book - Part 78 of 185The Ring programming language version 1.5.4 book - Part 78 of 185
The Ring programming language version 1.5.4 book - Part 78 of 185
 
Runtime Symbol Resolution
Runtime Symbol ResolutionRuntime Symbol Resolution
Runtime Symbol Resolution
 

Similar to Php 5.6 From the Inside Out

More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomValeriy Kravchuk
 
PHP 5.6 New and Deprecated Features
PHP 5.6  New and Deprecated FeaturesPHP 5.6  New and Deprecated Features
PHP 5.6 New and Deprecated FeaturesMark Niebergall
 
.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.orgTed Husted
 
Continuous Go Profiling & Observability
Continuous Go Profiling & ObservabilityContinuous Go Profiling & Observability
Continuous Go Profiling & ObservabilityScyllaDB
 
GopherCon IL 2020 - Web Application Profiling 101
GopherCon IL 2020 - Web Application Profiling 101GopherCon IL 2020 - Web Application Profiling 101
GopherCon IL 2020 - Web Application Profiling 101yinonavraham
 
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.4Wim Godden
 
Monitoring Kafka w/ Prometheus
Monitoring Kafka w/ PrometheusMonitoring Kafka w/ Prometheus
Monitoring Kafka w/ Prometheuskawamuray
 
The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010Bastian Feder
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6Wim Godden
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5Wim Godden
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest UpdatesIftekhar Eather
 
An introduction to PHP 5.4
An introduction to PHP 5.4An introduction to PHP 5.4
An introduction to PHP 5.4Giovanni Derks
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)julien pauli
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy CodeRowan Merewood
 
"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr VronskiyFwdays
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniZalando Technology
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionIan Barber
 

Similar to Php 5.6 From the Inside Out (20)

PHP7 Presentation
PHP7 PresentationPHP7 Presentation
PHP7 Presentation
 
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
 
PHP 5.6 New and Deprecated Features
PHP 5.6  New and Deprecated FeaturesPHP 5.6  New and Deprecated Features
PHP 5.6 New and Deprecated Features
 
.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.org
 
Continuous Go Profiling & Observability
Continuous Go Profiling & ObservabilityContinuous Go Profiling & Observability
Continuous Go Profiling & Observability
 
PHP Development Tools
PHP  Development ToolsPHP  Development Tools
PHP Development Tools
 
GopherCon IL 2020 - Web Application Profiling 101
GopherCon IL 2020 - Web Application Profiling 101GopherCon IL 2020 - Web Application Profiling 101
GopherCon IL 2020 - Web Application Profiling 101
 
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
 
Php
PhpPhp
Php
 
Monitoring Kafka w/ Prometheus
Monitoring Kafka w/ PrometheusMonitoring Kafka w/ Prometheus
Monitoring Kafka w/ Prometheus
 
The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest Updates
 
An introduction to PHP 5.4
An introduction to PHP 5.4An introduction to PHP 5.4
An introduction to PHP 5.4
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
 

More from Ferenc Kovács

Collaborative Terraform with Atlantis
Collaborative Terraform with AtlantisCollaborative Terraform with Atlantis
Collaborative Terraform with AtlantisFerenc Kovács
 
A PHP 5.5 újdonságai.
A PHP 5.5 újdonságai.A PHP 5.5 újdonságai.
A PHP 5.5 újdonságai.Ferenc Kovács
 
A PHP 5.4 újdonságai
A PHP 5.4 újdonságaiA PHP 5.4 újdonságai
A PHP 5.4 újdonságaiFerenc Kovács
 
Biztonságos webalkalmazások fejlesztése
Biztonságos webalkalmazások fejlesztéseBiztonságos webalkalmazások fejlesztése
Biztonságos webalkalmazások fejlesztéseFerenc Kovács
 
Webalkalmazások teljesítményoptimalizálása
Webalkalmazások teljesítményoptimalizálásaWebalkalmazások teljesítményoptimalizálása
Webalkalmazások teljesítményoptimalizálásaFerenc Kovács
 
PHP alkalmazások minőségbiztosítása
PHP alkalmazások minőségbiztosításaPHP alkalmazások minőségbiztosítása
PHP alkalmazások minőségbiztosításaFerenc Kovács
 

More from Ferenc Kovács (8)

Collaborative Terraform with Atlantis
Collaborative Terraform with AtlantisCollaborative Terraform with Atlantis
Collaborative Terraform with Atlantis
 
Monitorama
MonitoramaMonitorama
Monitorama
 
A PHP 5.5 újdonságai.
A PHP 5.5 újdonságai.A PHP 5.5 újdonságai.
A PHP 5.5 újdonságai.
 
Php 5.5
Php 5.5Php 5.5
Php 5.5
 
A PHP 5.4 újdonságai
A PHP 5.4 újdonságaiA PHP 5.4 újdonságai
A PHP 5.4 újdonságai
 
Biztonságos webalkalmazások fejlesztése
Biztonságos webalkalmazások fejlesztéseBiztonságos webalkalmazások fejlesztése
Biztonságos webalkalmazások fejlesztése
 
Webalkalmazások teljesítményoptimalizálása
Webalkalmazások teljesítményoptimalizálásaWebalkalmazások teljesítményoptimalizálása
Webalkalmazások teljesítményoptimalizálása
 
PHP alkalmazások minőségbiztosítása
PHP alkalmazások minőségbiztosításaPHP alkalmazások minőségbiztosítása
PHP alkalmazások minőségbiztosítása
 

Recently uploaded

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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
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
 
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
 
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 Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 

Recently uploaded (20)

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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
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
 
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
 
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 Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 

Php 5.6 From the Inside Out

  • 1. PHP 5.6 From The Inside Out
  • 2. Introduction ● Ferenc Kovacs ○ DevOps guy from Budapest, Hungary ○ Infrastructure Engineer at http://www.ustream.tv/ ○ Volunteer for the PHP project since 2011 ○ Release Manager for PHP 5.6 with Julien Pauli
  • 3. History of PHP 5.6 ● 2012-11-09: First commit ● 2013-11-06: PHP-5.6 branched out ● 2014-01-23: PHP-5.6.0alpha1(rfc freeze) ● 2014-04-11: PHP-5.6.0beta1(feature freeze) ● 2014-06-19: PHP-5.6.0RC1 ● 2014-08-28: PHP-5.6.0
  • 4. Some stats about the changes Version Released Commits Authors LOC added LOC deleted 5.3.0 2009-06-30 5339 83 1575768 756904 5.4.0 2012-03-01 18779 135 3701590 2150397 5.5.0 2013-06-20 2842 113 287785 164481 5.6.0 2014-08-28 2013 107 496200 1235336 7.0 N/A 3671 90 531825 1315925
  • 5. Release Process https://wiki.php.net/rfc/releaseprocess tl;dr: ● yearly release schedule(timeboxing), 2+1 year support cycle. ● guidelines about what is allowed in a major/minor/micro version. ● resulting smaller, more predictable releases which are easier to upgrade to.
  • 6. Changes in 5.6 1. BC breaks 2. New features 3. Deprecated features
  • 7. BC breaks ● json_decode() only accepts lowercase for true/false/null to follow the JSON spec. ● Stream wrappers now verify peer certificates and host names by default when using SSL/TLS. ● GMP resources are now objects. ● Mcrypt functions now require valid keys and IVs.
  • 8. BC breaks ● unserialize() now validates the serialize format for classes implementing Serializable. ○ class Foo ■ O:3:"Foo":0:{} ○ class Foo implements Serializable ■ C:3:"Foo":4:{r:1;} ○ Can be a problem if you handcrafting the strings (PHPUnit, Doctrine) or storing those somewhere and the class definition changes(Horde).
  • 9. BC breaks ● using the @file syntax for curl file uploads are only supported if option CURLOPT_SAFE_UPLOAD is set to false. CURLFile should be used instead.
  • 10. BC breaks <?php class C { const ONE = 1; public $array = [ self::ONE => 'foo', 'bar', 'quux', ]; } count((new C)->array); // 2 on <=5.5 but 3 on >=5.6 ?>
  • 11. New features The big ones ● Constant scalar expressions ● Variadic functions ● Argument unpacking ● Power operator ● use function and use const ● phpdbg ● SSL/TLS improvements
  • 12. Constant scalar expressions <?php const ONE = 1; const TWO = ONE * 2; class C { const THREE = TWO + 1; const ONE_THIRD = ONE / self::THREE; const SENTENCE = 'The value of THREE is '.self::THREE; public function f($a = ONE + self::THREE) { return $a; } } echo (new C)->f()."n"; // 4 echo C::SENTENCE; // The value of THREE is 3 ?>
  • 13. Variadic functions <?php function f($req, $opt = null, ...$params) { // $params is an array containing the remaining arguments. printf('$req: %d; $opt: %d; number of params: %d'."n", $req, $opt, count($params)); } f(1); // $req: 1; $opt: 0; number of params: 0 f(1, 2); // $req: 1; $opt: 2; number of params: 0 f(1, 2, 3); // $req: 1; $opt: 2; number of params: 1 f(1, 2, 3, 4); // $req: 1; $opt: 2; number of params: 2 f(1, 2, 3, 4, 5); // $req: 1; $opt: 2; number of params: 3 ?>
  • 14. Argument Unpacking <?php function add($a, $b, $c) { return $a + $b + $c; } $operators = [2, 3]; echo add(1, ...$operators); // 6 ?>
  • 15. Power operator <?php printf("2 ** 3 == %dn", 2 ** 3); // 2** 3 == 8 printf("2 ** 3 ** 2 == %dn", 2 ** 3 ** 2); // 2 ** 3 ** 2 == 512 $a = 2; $a **= 3; printf("a == %dn", $a); // a == 8 ?>
  • 16. use function and use const <?php namespace NameSpace { const FOO = 42; function f() { echo __FUNCTION__."n"; } } namespace { use const NameSpaceFOO; use function NameSpacef; echo FOO."n"; // 42 f(); // NameSpacef } ?>
  • 17. phpdbg New SAPI for debugging php scripts ● really handy for debugging cli scripts or debugging without an IDE. ● no out-of-the-box solution for debugging web requests(WIP). ● no IDE integration yet(WIP). ● those familiar with gdb will probably like it.
  • 18. phpdbg features ● list source for line/function/method/class ● show info about current files/classes/functions/etc. ● print opcodes for classes/functions/current execution context, etc. ● traverse and sho information about stackframes
  • 19. phpdbg features ● show the current backtrace. ● set execution context. ● run the current execution context. ● step through the execution. ● continue the execution until the next breakpoint/watchpoint. ● continue the execution until the next breakpoint/watchpoint after the given line.
  • 20. phpdbg features ● continue the execution skipping any breakpoint/watchpoint until the current frame is finished. ● continue the execution skipping any breakpoint/watchpoint to right before we leave the current frame.
  • 21. phpdbg features ● set a conditional expression on the target where execution will break if the expression evaluates true. ● set a watchpoint on variable. ● clear breakpoints. ● clean up the execution environment(remove constant/function/class definitions).
  • 22. phpdbg features ● set the phpdbg configuration. ● source a phpdbginit script. ● register a phpdbginit function as an alias. ● shell a command. ● evaluate some code. ● quit.
  • 23. SSL/TLS improvements ● Stream wrappers now verify peer certificates and host names by default when using SSL/TLS. ● Added support SAN x509 extension matching for verifying host names in encrypted streams. ● New SSL context options for improved stream server security.
  • 24. SSL/TLS improvements ● Added support for Server Name Indication. ● Added protocol-specific encryption stream wrappers (tlsv1.0://, tlsv1.1:// and tlsv1.2://). ● Added support for managing SPKAC/SPKI.
  • 25. Other features ● __debugInfo() magic method for intercepting var_dump(); ● php://input is reusable ● Large file uploads (>2GB) are now accepted. ● The new GMP objects now support operator overloading. ● hash_equals() for constant time string comparison.
  • 26. Other features ● gost-crypto hash algo was added. ● PostgreSQL async support ○ pg_connect($dsn, PGSQL_CONNECT_ASYNC); ○ pg_connect_poll(); ○ pg_socket(); ○ pg_consume_input(); ○ pg_flush(); ● ReflectionClass:: newInstanceWithoutConstructor() can instantiate almost everything.
  • 27. Other features ● The default value for default_charset changed to UTF-8, html* iconv* and mbstring* function will use this value when no explicit encoding is set/passed. ● New fetching mode for mysqlnd, controlled via mysqlnd.fetch_data_copy. ○ Will use less memory but do more copying.
  • 28. Deprecated features ● Calls from incompatible context will now emit E_DEPRECATED instead of E_STRICT ● always_populate_raw_post_data now have a new value(-1), which completely disables the population of $HTTP_RAW_POST_DATA, setting it anything else will emit an E_DEPRECATED.
  • 29. Deprecated features ● The following settings are all deprecated in favor of default_charset: ○ iconv.input_encoding ○ iconv.output_encoding ○ iconv.internal_encoding ○ mbstring.http_input ○ mbstring.http_output ○ mbstring.internal_encoding
  • 30. Thanks for your attention! Slides will be here: http://www.slideshare.net/Tyrael If you have any questions: tyrael@php.net @Tyr43l