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
78
0
Share
PHP v5.3+ Features
Overview of main features from PHP v5.3 until current v5.6
Michael Bui
September 29, 2014
More Decks by Michael Bui
See All by Michael Bui
Boeing (BA) Analysis - Adam Khoo | Group O 2018
michaelbui
0
150
Asynchronous processing using AWS Services
michaelbui
0
54
Microservice
michaelbui
2
790
Other Decks in Programming
See All in Programming
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
880
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
6
1.1k
誰も頼んでない機能を出荷した話
zekutax
0
140
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
120
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
280
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
910
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.2k
バックエンドにElysiaJSを採用して気付いた、良い点・悪い点
wanko_it
1
180
LLM Plugin for Node-REDの利用方法と開発について
404background
0
130
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
320
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
130
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
260
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
It's Worth the Effort
3n
188
29k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Ruling the World: When Life Gets Gamed
codingconduct
0
240
Crafting Experiences
bethany
1
160
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
350
Statistics for Hackers
jakevdp
799
230k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
340
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)