Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
110
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
450
Rapid Application Development with Symfony Framework
redecs
1
190
Making Emails Suck Less
redecs
0
77
Managing your code with Composer and Satis
redecs
0
150
Snapper.VU @ Fearless Conference 2015 - Romania
redecs
0
100
Other Decks in Programming
See All in Programming
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
100
CSC509 Lecture 14
javiergs
PRO
0
220
dotfiles 式年遷宮 令和最新版
masawada
1
760
認証・認可の基本を学ぼう後編
kouyuume
0
190
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
120
Microservices rules: What good looks like
cer
PRO
0
1.3k
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
390
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
110
FluorTracer / RayTracingCamp11
kugimasa
0
230
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
310
俺流レスポンシブコーディング 2025
tak_dcxi
14
8.6k
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
6
2.2k
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Visualization
eitanlees
150
16k
The Cult of Friendly URLs
andyhume
79
6.7k
Building Applications with DynamoDB
mza
96
6.8k
Mobile First: as difficult as doing things right
swwweet
225
10k
Designing for Performance
lara
610
69k
Optimizing for Happiness
mojombo
379
70k
Making Projects Easy
brettharned
120
6.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
We Have a Design System, Now What?
morganepeng
54
7.9k
Speed Design
sergeychernyshev
33
1.4k
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 ?>