SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Último (20)

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

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