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
Talks #75 - PHP 7
Search
Mihai Nica
November 11, 2015
Programming
1
84
Talks #75 - PHP 7
PHP7 it's almost ready. Let's do a quick review of the biggest PHP release since 5.3.
Mihai Nica
November 11, 2015
Tweet
Share
More Decks by Mihai Nica
See All by Mihai Nica
Making the most out of Symfony Forms
redecs
0
380
Rapid Application Development with Symfony Framework
redecs
1
170
Making Emails Suck Less
redecs
0
58
Managing your code with Composer and Satis
redecs
0
120
Snapper.VU @ Fearless Conference 2015 - Romania
redecs
0
83
Other Decks in Programming
See All in Programming
Security_for_introducing_eBPF
kentatada
0
110
命名をリントする
chiroruxx
1
390
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
770
MCP with Cloudflare Workers
yusukebe
2
220
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
460
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
320
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
1k
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
2
460
Featured
See All Featured
The Cult of Friendly URLs
andyhume
78
6.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Automating Front-end Workflow
addyosmani
1366
200k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Six Lessons from altMBA
skipperchong
27
3.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Code Reviewing Like a Champion
maltzj
520
39k
Faster Mobile Websites
deanohume
305
30k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Transcript
<?PHP 7 PHP developers don’t know how to count
PHP 7 Highlights • Scalar type declarations • Return type
declarations • Null coalesce operator ?? • Combined comparison operator <=> • Anonymous classes • Way faster then previous release
Scalar Typehints • bool, float, int, string • declare(strict_types=1) •
function sum(int $a, int $b) { return $a + $b }
Return type declarations • Same types as for argument type
declarations • function sum(int $a, int $b):int { return $a + $b }
Null coalesce operator ?? • Because we are lazy and
other languages have it • $u = isset($_GET['user']) ? $_GET['user'] : 'nobody'; becomes $u = $_GET['user'] ?? 'nobody';
Combined comparison operator <=> • aka Spaceship operator • sorting
the right way • echo 1 <=> 1; // 0 echo 1 <=> 2; // -1 echo 2 <=> 1; // 1
Anonymous classes • Throwaway objects made easy • Testers rejoice
• $app = new Application; $app->setLogger(new class implements Logger { public function log(string $msg) { echo $msg; } });
2X faster?! • PHP Framework Benchmark available on Github: http://rtr.im/y
• Virtual machine (2 cores @ 3.4GHz, 4GB RAM) running Ubuntu 14.04 • nginx 1.6 + php-fpm
PHP 5.5.15
PHP 7.0 RC7
FRAMEWORK REQUEST PER SECOND PHP 5.5.15 PHP 7 - RC7
PHALCON-2.0 1469 6605 CI-3.0 314 918 LUMEN-5.1 223 1345 YII-2.0 189 363 SILEX-1.3 486 1822 AURA-2.0 257 1080 CAKE-3.1 174 472 SYMFONY-2.7 167 326 LARAVEL-5.1 80 72 ZF-2.5 40 445
•
[email protected]
• https://twiter.com/redecs • https://facebook.com/redecs Mihai
Nica ?>