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
56
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
40
Microservice
michaelbui
2
730
Other Decks in Programming
See All in Programming
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
7
1.4k
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
6
700
HTML/CSS超絶浅い説明
yuki0329
0
190
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
280
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
php-conference-japan-2024
tasuku43
0
430
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
870
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
テストコード書いてみませんか?
onopon
2
340
ESLintプラグインを使用してCDKのセオリーを適用する
yamanashi_ren01
2
230
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
300
Featured
See All Featured
Music & Morning Musume
bryan
46
6.3k
Docker and Python
trallard
43
3.2k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
GitHub's CSS Performance
jonrohan
1030
460k
Facilitating Awesome Meetings
lara
51
6.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
Gamification - CAS2011
davidbonilla
80
5.1k
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)