Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PHP v5.3+ Features
Search
Michael Bui
September 29, 2014
Programming
0
59
PHP v5.3+ Features
Overview of main features from PHP v5.3 until current v5.6
Michael Bui
September 29, 2014
Tweet
Share
More Decks by Michael Bui
See All by Michael Bui
Boeing (BA) Analysis - Adam Khoo | Group O 2018
michaelbui
0
140
Asynchronous processing using AWS Services
michaelbui
0
42
Microservice
michaelbui
2
750
Other Decks in Programming
See All in Programming
TypeScript エンジニアが Android 開発の世界に飛び込んだ話
yuisakamoto
6
890
TypeScriptのmoduleオプションを改めて整理する
bicstone
4
410
がんばりすぎないコーディングルール運用術
tsukakei
1
160
Interface vs Types ~型推論が過多推論~
hirokiomote
1
220
Investigating Multithreaded PostgreSQL
macdice
0
140
TVer iOSチームの共通認識の作り方 - Findy Job LT iOSアプリ開発の裏側 開発組織が向き合う課題とこれから
techtver
PRO
0
670
DevDay2025-OracleDatabase-kernel-addressing-history
oracle4engineer
PRO
6
1.6k
抽象データ型について学んだ
ryounasso
0
200
コンポーネントライブラリで実現する、アクセシビリティの正しい実装パターン
schktjm
1
620
ソフトウェア品質特性、意識してますか?AIの真の力を引き出す活用事例 / ai-and-software-quality
minodriven
19
6.5k
PT AI без купюр
v0lka
0
180
Use Perl as Better Shell Script
karupanerura
0
590
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
How to Ace a Technical Interview
jacobian
276
23k
Balancing Empowerment & Direction
lara
1
81
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
RailsConf 2023
tenderlove
30
1.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
460
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Producing Creativity
orderedlist
PRO
346
40k
Why Our Code Smells
bkeepers
PRO
336
57k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
The Cost Of JavaScript in 2023
addyosmani
49
8k
Transcript
PHP v5.3+ FEATURES Michael Bui (FB & TW: MichaelBui2812)
PHP v5.3 • “ereg” deprecated • SPL always enabled •
Reflection always enabled • Magic methods ◦ __invoke() ◦ __callStatic() • Performance improved
PHP v5.3 • Namespace ◦ PSR-0 ◦ Composer ◦ For
classes, functions and constants • Import classes ◦ “use” keyword ◦ relative & absolute namespaces • Closures
PHP v5.4 • PHP_BINARY constant • Array to string conversions
will trigger a notice • Array callbacks: ◦ [$obj, ‘method’] ◦ [‘ClassName’, ‘method’] • Memory & performance improved
PHP v5.4 • Traits ◦ “compiler level” copy-n-paste (literally) ◦
“insteadof” & “as” to solve collisions • Closures ◦ Support “$this” ◦ Re-bind “$this” • Short echo tags “<?=...?>” always work • Binary numbers (0b...)
PHP v5.4 (Cont.) • Short array syntax: ◦ [‘a’=>1,’b’=>2] ===
array(‘a’=>1,’b’=>2) ◦ Array dereferencing: getArray()[0]; • Initiation time access ◦ (new Classname())->method() • Dynamic method calls: ◦ ClassName::{$var}() ◦ (new ClassName())->{$var}()
PHP v5.5 • RegExp /e modifier deprecated • Mysql extension
officially deprecated • boolval() • empty() support any expression • OPCache built-in
PHP v5.5 • “finally” supported • Fully qualified classname constant
◦ ClassName::CLASS • Literal Dereferencing ◦ [‘a’,’b’,’c’][1] will return ‘b’ • “foreach” support “list()” ◦ foreach ($records as list($name, $email)) {} • Generators & Co-routines
PHP v5.6 • Import functions & constants ◦ use function
Name\Spaced\method; ◦ use const Name\Spaced\CONSTANT; • Scalar expressions supported in ◦ Constants: const FOO = self::BAR . “!”; ◦ Class properties: public $a = 1 + 1; ◦ Function arguments: function f($a = 1 + 1) {} ◦ … • __debugInfo()
PHP v5.6 (cont.) • Variadic functions ◦ Referencing ◦ Type
hinting • Argument unpacking • Exponent operator (**) • Upload more than 2GB
ONE MORE THING...
THANK YOU! Michael Bui (FB & TW: MichaelBui2812)