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
53
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
110
Asynchronous processing using AWS Services
michaelbui
0
35
Microservice
michaelbui
2
680
Other Decks in Programming
See All in Programming
Git Lint
bkuhlmann
4
750
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
710
VS Code をプロダクトにどう取り込むか
onomax
1
350
Elm Form Validation
bkuhlmann
0
510
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
720
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
200
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
4k
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
410
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
280
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
250
HUIT新歓2024「競技プログラミング、やってみませんか?」
slephy2784
1
270
Featured
See All Featured
The Invisible Side of Design
smashingmag
294
49k
Building Your Own Lightsaber
phodgson
99
5.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
227
16k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Web development in the modern age
philhawksworth
202
10k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.9k
Embracing the Ebb and Flow
colly
80
4.1k
Design by the Numbers
sachag
274
18k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
274
13k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
Git: the NoSQL Database
bkeepers
PRO
422
63k
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)