SlideShare a Scribd company logo
PHP 5.5
Whats New!!

Presented By : Naseer Ahmad
Performance and Memory
Performance by 10-30%
Memory by 50%
●
●

precompiled script bytecode in shared memory
reduction in loading and parsing of scripts on every request

HOW???

!! Zend Optimizer & opcode cache !!
Available in PECL for PHP versions 5.2, 5.3 and 5.4
Php 5.5
New Features
● Finally keyword.
● foreach supporting lists now.
<?php
$array = [
[1, 2],
[3, 4],
];
foreach ($array as list($a, $b)) {
echo "A: $a; B: $bn";
}
?>
New Features
● empty() supports arbitrary expression.
● Class name resolution via ::class
<?php
namespace NameSpace;
class ClassName {}
echo ClassName::class; //NameSpaceClassName
?>
New Features(Array & String Direct Referencing)
<?php
echo 'Array dereferencing: ';
echo [1, 2, 3][0];

Print : Array dereferencing : 1

echo "n";
echo 'String dereferencing: ';
echo 'PHP'[0];
echo "n";
?>

Print : String dereferencing: P
New Features(Generators)
●
●
●
●

Routine to control the iteration of a loop
Sequence of values in loop
Values on demand
In simple words, put foreach over a function
:)
New Features(Generators)

Fine for normal usage
What if we want to abstract it?
Generators
New Features(Generators)

Simpler, lesser code
New Features(Password Hashing Api)
> Php 5.5
Relying on
● custom hash methods
● somewhat confusing crypt() method

Php 5.5
Hashing api, wrapper around crypt()
No external libraries,no additional installation
PASSWORD_BCRYPT hashing algorithm, 60 characters hash.
Salt and Cost options.
<?php
$timeTarget = 0.2;
$cost = 9;
do {
$cost++;
$start = microtime(true);
password_hash("test", PASSWORD_BCRYPT, ["cost" => $cost]);
$end = microtime(true);
} while (($end - $start) < $timeTarget);
echo "Appropriate Cost Found: " . $cost; //Appropriate Cost Found: 11
?>
New Features(Password Hashing Api)
● password_get_info — Returns information about the
given hash
● password_hash — Creates a password hash
● password_needs_rehash — Checks if the given hash
matches the given options
● password_verify — Verifies that a password matches a
hash
New Features(Password Hashing Api)
<?php
$hash = password_hash(‘MyPassword’, PASSWORD_DEFAULT);
if(password_verify(‘MyPassword’, $hash)){
echo “Password is valid!!”;
}
else{ echo “invalid password.”}
?>
References
http://be1.php.net/migration55.new-features
http://www.sitepoint.com/generators-in-php/
http://geekmonkey.org/articles/39-php-5-5-generators
http://blog.ircmaxell.com/2012/07/what-generators-can-do-for-you.html
http://blog.asmallorange.com/2013/08/php-roadmap-performance/
http://php.net/manual/en/function.password-hash.php
http://uk1.php.net/manual/en/book.opcache.php
https://support.cloud.engineyard.com/entries/26902267-PHP-Performance-IEverything-You-Need-to-Know-About-OpCode-Caches

More Related Content

PPTX
Introduction to php
PPTX
PHP FUNCTIONS
PDF
Php a dynamic web scripting language
PPT
PDF
Introduction to PHP
PDF
4.2 PHP Function
PPTX
Introduction to PHP
Introduction to php
PHP FUNCTIONS
Php a dynamic web scripting language
Introduction to PHP
4.2 PHP Function
Introduction to PHP

What's hot (20)

PPTX
PHP Function
PPT
01 Php Introduction
PPT
Class 6 - PHP Web Programming
PDF
Php introduction
PPT
PPT
Php(report)
PDF
Damien seguy php 5.6
PPTX
Php.ppt
PPT
Php hypertext pre-processor
PDF
Introduction to php web programming - get and post
PPTX
PPT
Beginners PHP Tutorial
PPT
Introduction To PHP
PPTX
Constructor and encapsulation in php
PPTX
Powershell Demo Presentation
PPT
Introduction To Lamp
PDF
Php tutorial
PPT
PHP complete reference with database concepts for beginners
PHP Function
01 Php Introduction
Class 6 - PHP Web Programming
Php introduction
Php(report)
Damien seguy php 5.6
Php.ppt
Php hypertext pre-processor
Introduction to php web programming - get and post
Beginners PHP Tutorial
Introduction To PHP
Constructor and encapsulation in php
Powershell Demo Presentation
Introduction To Lamp
Php tutorial
PHP complete reference with database concepts for beginners
Ad

Similar to Php 5.5 (20)

ODP
What is new in PHP 5.5 - HuyenNT
PPTX
PHP 5.5.0 ChangeLog
ODP
Php in 2013 (Web-5 2013 conference)
ODP
PHP5.5 is Here
ODP
The why and how of moving to PHP 5.4/5.5
ODP
The why and how of moving to php 5.4/5.5
PDF
Preparing for the next PHP version (5.6)
PDF
Php v5.3+ features
PDF
What's new in PHP 5.5
PPTX
PHP 5.6 New and Deprecated Features
PPT
ZendCon 08 php 5.3
ODP
The why and how of moving to PHP 5.5/5.6
ODP
The why and how of moving to php 5.4
PDF
What's New in PHP 5.5
PDF
Php 5.6 From the Inside Out
PDF
Modern PHP
PDF
PHP7: Hello World!
PDF
An introduction to PHP 5.4
PDF
PHP 5.4 - Begin your love affair with traits
PDF
Key features PHP 5.3 - 5.6
What is new in PHP 5.5 - HuyenNT
PHP 5.5.0 ChangeLog
Php in 2013 (Web-5 2013 conference)
PHP5.5 is Here
The why and how of moving to PHP 5.4/5.5
The why and how of moving to php 5.4/5.5
Preparing for the next PHP version (5.6)
Php v5.3+ features
What's new in PHP 5.5
PHP 5.6 New and Deprecated Features
ZendCon 08 php 5.3
The why and how of moving to PHP 5.5/5.6
The why and how of moving to php 5.4
What's New in PHP 5.5
Php 5.6 From the Inside Out
Modern PHP
PHP7: Hello World!
An introduction to PHP 5.4
PHP 5.4 - Begin your love affair with traits
Key features PHP 5.3 - 5.6
Ad

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
A Presentation on Artificial Intelligence
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Cloud computing and distributed systems.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Electronic commerce courselecture one. Pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
cuic standard and advanced reporting.pdf
PPT
Teaching material agriculture food technology
Programs and apps: productivity, graphics, security and other tools
20250228 LYD VKU AI Blended-Learning.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A Presentation on Artificial Intelligence
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
Cloud computing and distributed systems.
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
Electronic commerce courselecture one. Pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cuic standard and advanced reporting.pdf
Teaching material agriculture food technology

Php 5.5