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
370
Rapid Application Development with Symfony Framework
redecs
1
170
Making Emails Suck Less
redecs
0
56
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
距離関数を極める! / SESSIONS 2024
gam0022
0
290
flutterkaigi_2024.pdf
kyoheig3
0
150
Ethereum_.pdf
nekomatu
0
470
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
980
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
Jakarta EE meets AI
ivargrimstad
0
670
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Macとオーディオ再生 2024/11/02
yusukeito
0
370
Featured
See All Featured
Scaling GitHub
holman
458
140k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
What's in a price? How to price your products and services
michaelherold
243
12k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
How GitHub (no longer) Works
holman
310
140k
It's Worth the Effort
3n
183
27k
Building Applications with DynamoDB
mza
90
6.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Become a Pro
speakerdeck
PRO
25
5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
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 ?>