SlideShare a Scribd company logo
What’s new
PHP 5.6
Hello!!!
(New features
&& functions)
Constant scalar expressions
const ONE = 1;
const TWO = ONE * 2;
echo ONE; // 1
echo TWO; // 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(); //4
echo C::SENTENCE; //The value of THREE is 3
Variadic functions via …
&&
Argument unpacking via ...
function ides() {
$cant = func_num_args();
echo "Ides count: ".$cant;
}
ides('Eclipse', 'Netbeas');
// Ides count 2
Before
function ides($ide, ...$ides) {
echo "Ides count: ".count($ides);
}
ides (
'Eclipse', 'Netbeas', 'Sublime'
);
// Ides count 2
Now
function sum(...$numbers) {
$acc = 0;
foreach ($numbers as $n) {
$acc += $n;
}
return $acc;
}
echo sum(1, 2, 3, 4); // 10
function add($a, $b) {
return $a + $b;
}
echo add(...[1, 2]); // 3
$a = [1, 2];
echo add(...$a); // 3
function showNames($welcome, Person ...$people) {
echo $welcome.PHP_EOL;
foreach ($people as $person) {
echo $person->name.PHP_EOL;
}
}
$a = new Person('Federico');
$b = new Person('Damian');
showNames('Welcome: ', $a, $b);
//Welcome:
//Federico
//Damian
Exponentiation via **
printf("2 ** 3 == %dn", 2 ** 3);
printf("2 ** 3 ** 2 == %dn", 2 ** 3 ** 2);
$a = 2;
$a **= 3;
printf("a == %dn", $a);
// 2 ** 3 == 8
// 2 ** 3 ** 2 == 512
// a == 8
use function & use const
namespace NameSpace {
const FOO = 42;
function f() { echo __FUNCTION__."n"; }
}
namespace {
use const NameSpaceFOO;
use function NameSpacef;
echo FOO."n"; // 42
f(); // NameSpacef
}
__debugInfo()
class C {
private $prop;
public function __construct($val) {
$this->prop = $val;
}
public function __debugInfo() {
return [
'propSquared' => $this->prop ** 2
];
}
}
var_dump(new C(42));
object(C)#1 (1) {
["propSquared"]=> int(1764)
}
default character encoding
htmlentities()
html_entity_decode()
htmlspecialchars()
< 5.4
ISO-8859-1
5.4 - 5.5
UTF-8
>= 5.6
default_charset is used
Others features
&&
functions
Large File Upload
It is possible to upload a file larger than 2 GB
php://input is reusable
phpdbg
Hash
- hash_equals()
LDAP
- ldap_escape()
- ldap_modify_batch()
Mysqli
- mysqli_get_links_stats()
PostgreSQL
- pg_connect_poll()
- ...
OCI8
- oci_get_implicit_resulset()
OpenSSL
- openssl_get_cert_location()
- openssl_x509_fingerprint()
- openssl_spki_new()
- …
Session
- session_abort()
- session_reset()
Sorry
I'm different
(backward incompatible changes & deprecates)
json_decode() strictness
$json_data = json_decode('tRue');
var_dump($json_data);
var_dump(json_last_error_msg());
bool(true)
string(8) "No error"
Before
NULL
string(12) "Syntax error"
Now
Array Values and Overwriting
class helloWorld {
const ONE = 1;
public $array = [
self::ONE => 'Eclipse',
'Sublime',
'PHPStorm',
];
}
$hello = new helloWorld();
print_r($hello);
helloWorld Object
(
[array] => Array
(
[0] => Sublime
[1] => PHPStorm
)
)
helloWorld Object
(
[array] => Array
(
[1] => Eclipse
[2] => Sublime
[3] => PHPStorm
)
)
Before Now
Calls from incompatible context
class A {
function f() { echo
get_class($this); }
}
class B {
function f() { A::f(); }
}
(new B)->f();
//output
PHP Deprecated: Non-static method A::f() should not be called
statically, assuming $this from incompatible context in ...
HTTP_RAW_POST_DATA
always_populate_raw_post_data
Questions
Php 5.6

More Related Content

What's hot (20)

PDF
Exploring ES6
Ximing Dai
 
PDF
Bag of tricks
brian d foy
 
PDF
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
James Titcumb
 
PDF
Swift 3.0 の新しい機能(のうちの9つ)
Tomohiro Kumagai
 
PPTX
C Programming Language Step by Step Part 2
Rumman Ansari
 
PDF
Slide
Naing Lin Aung
 
ODP
Отладка в GDB
Anthony Shoumikhin
 
PDF
Learning Perl 6 (NPW 2007)
brian d foy
 
PDF
Александр Трищенко: PHP 7 Evolution
Oleg Poludnenko
 
PDF
Learning Perl 6
brian d foy
 
PDF
Swift - Krzysztof Skarupa
Sunscrapers
 
PPTX
Introduction to Perl Programming
Collaboration Technologies
 
ODP
null Pune meet - Application Security: Code injection
n|u - The Open Security Community
 
PPTX
PHP in 2018 - Q4 - AFUP Limoges
✅ William Pinaud
 
KEY
SPL, not a bridge too far
Michelangelo van Dam
 
PDF
OSDC.TW - Gutscript for PHP haters
Lin Yo-An
 
PDF
Hello Swift 3/5 - Function
Cody Yun
 
PDF
Swift で JavaScript 始めませんか? #iOSDC
Tomohiro Kumagai
 
PDF
ClojurianからみたElixir
Kent Ohashi
 
PDF
AnyObject – 自分が見落としていた、基本の話
Tomohiro Kumagai
 
Exploring ES6
Ximing Dai
 
Bag of tricks
brian d foy
 
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
James Titcumb
 
Swift 3.0 の新しい機能(のうちの9つ)
Tomohiro Kumagai
 
C Programming Language Step by Step Part 2
Rumman Ansari
 
Отладка в GDB
Anthony Shoumikhin
 
Learning Perl 6 (NPW 2007)
brian d foy
 
Александр Трищенко: PHP 7 Evolution
Oleg Poludnenko
 
Learning Perl 6
brian d foy
 
Swift - Krzysztof Skarupa
Sunscrapers
 
Introduction to Perl Programming
Collaboration Technologies
 
null Pune meet - Application Security: Code injection
n|u - The Open Security Community
 
PHP in 2018 - Q4 - AFUP Limoges
✅ William Pinaud
 
SPL, not a bridge too far
Michelangelo van Dam
 
OSDC.TW - Gutscript for PHP haters
Lin Yo-An
 
Hello Swift 3/5 - Function
Cody Yun
 
Swift で JavaScript 始めませんか? #iOSDC
Tomohiro Kumagai
 
ClojurianからみたElixir
Kent Ohashi
 
AnyObject – 自分が見落としていた、基本の話
Tomohiro Kumagai
 

Similar to Php 5.6 (20)

PDF
Php 5.6 From the Inside Out
Ferenc Kovács
 
PDF
Preparing for the next PHP version (5.6)
Damien Seguy
 
PDF
Damien seguy php 5.6
Damien Seguy
 
PPTX
PHP7 Presentation
David Sanchez
 
PDF
PHP 7.0 new features (and new interpreter)
Andrea Telatin
 
ODP
Php in 2013 (Web-5 2013 conference)
julien pauli
 
PDF
Introduction to PHP
Bradley Holt
 
ODP
New Stuff In Php 5.3
Chris Chubb
 
ODP
The why and how of moving to php 5.4
Wim Godden
 
PDF
Giới thiệu PHP 7
ZendVN
 
PPTX
Php 5.4: New Language Features You Will Find Useful
David Engel
 
PPTX
Introducing PHP Latest Updates
Iftekhar Eather
 
ODP
What's new, what's hot in PHP 5.3
Jeremy Coates
 
PPT
ZendCon 08 php 5.3
webhostingguy
 
PDF
PHP 5
Rafael Corral
 
PDF
Introduction to PHP 5.3
guestcc91d4
 
PPTX
20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...
DrupalMumbai
 
PPTX
PHP 5.6 New and Deprecated Features
Mark Niebergall
 
PPTX
Learning php 7
Ed Lomonaco
 
Php 5.6 From the Inside Out
Ferenc Kovács
 
Preparing for the next PHP version (5.6)
Damien Seguy
 
Damien seguy php 5.6
Damien Seguy
 
PHP7 Presentation
David Sanchez
 
PHP 7.0 new features (and new interpreter)
Andrea Telatin
 
Php in 2013 (Web-5 2013 conference)
julien pauli
 
Introduction to PHP
Bradley Holt
 
New Stuff In Php 5.3
Chris Chubb
 
The why and how of moving to php 5.4
Wim Godden
 
Giới thiệu PHP 7
ZendVN
 
Php 5.4: New Language Features You Will Find Useful
David Engel
 
Introducing PHP Latest Updates
Iftekhar Eather
 
What's new, what's hot in PHP 5.3
Jeremy Coates
 
ZendCon 08 php 5.3
webhostingguy
 
Introduction to PHP 5.3
guestcc91d4
 
20 cool features that is in PHP 7, we missed in PHP 5. Let walkthrough with t...
DrupalMumbai
 
PHP 5.6 New and Deprecated Features
Mark Niebergall
 
Learning php 7
Ed Lomonaco
 
Ad

More from Federico Damián Lozada Mosto (7)

PDF
Solid Principles & Design patterns with PHP examples
Federico Damián Lozada Mosto
 
PDF
Implementando una Arquitectura de Microservicios
Federico Damián Lozada Mosto
 
PDF
Key features PHP 5.3 - 5.6
Federico Damián Lozada Mosto
 
PDF
Travis-CI - Continuos integration in the cloud for PHP
Federico Damián Lozada Mosto
 
PDF
Introduction to unit testing
Federico Damián Lozada Mosto
 
Solid Principles & Design patterns with PHP examples
Federico Damián Lozada Mosto
 
Implementando una Arquitectura de Microservicios
Federico Damián Lozada Mosto
 
Key features PHP 5.3 - 5.6
Federico Damián Lozada Mosto
 
Travis-CI - Continuos integration in the cloud for PHP
Federico Damián Lozada Mosto
 
Introduction to unit testing
Federico Damián Lozada Mosto
 
Ad

Recently uploaded (20)

PDF
10 Salesforce Consulting Companies in Sydney.pdf
DianApps Technologies
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
Simplify React app login with asgardeo-sdk
vaibhav289687
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PDF
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 
PPTX
From spreadsheets and delays to real-time control
SatishKumar2651
 
PDF
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
PDF
Windows 10 Professional Preactivated.pdf
asghxhsagxjah
 
PDF
NPD Software -Omnex systems
omnex systems
 
PDF
Best Web development company in india 2025
Greenusys
 
10 Salesforce Consulting Companies in Sydney.pdf
DianApps Technologies
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Simplify React app login with asgardeo-sdk
vaibhav289687
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 
From spreadsheets and delays to real-time control
SatishKumar2651
 
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
Windows 10 Professional Preactivated.pdf
asghxhsagxjah
 
NPD Software -Omnex systems
omnex systems
 
Best Web development company in india 2025
Greenusys
 

Php 5.6