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
95
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
410
Rapid Application Development with Symfony Framework
redecs
1
180
Making Emails Suck Less
redecs
0
64
Managing your code with Composer and Satis
redecs
0
130
Snapper.VU @ Fearless Conference 2015 - Romania
redecs
0
94
Other Decks in Programming
See All in Programming
Design Pressure
hynek
0
1.4k
try-catchを使わないエラーハンドリング!? PHPでResult型の考え方を取り入れてみよう
kajitack
3
140
iOSアプリ開発もLLMで自動運転する
hiragram
6
1.9k
SpringBootにおけるオブザーバビリティのなにか
irof
1
850
2025年のz-index設計を考える
tak_dcxi
13
5.1k
#QiitaBash TDDでAIに設計イメージを伝える
ryosukedtomita
2
1.2k
コンポーネントライブラリで実現する、アクセシビリティの正しい実装パターン
schktjm
1
600
ユーザーにサブドメインの ECサイトを提供したい (あるいは) 2026年函館で一番熱くなるかもしれない言語の話
uvb_76
0
160
「MCPを使ってる人」が より詳しくなるための解説
yamaguchidesu
0
290
型付け力を強化するための Hoogle のすゝめ / Boosting Your Type Mastery with Hoogle
guvalif
1
210
AIにコードを生成するコードを作らせて、再現性を担保しよう! / Let AI generate code to ensure reproducibility
yamachu
7
5.6k
人には人それぞれのサービス層がある
shimabox
2
320
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1031
460k
Music & Morning Musume
bryan
47
6.5k
Done Done
chrislema
184
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Docker and Python
trallard
44
3.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.7k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.6k
For a Future-Friendly Web
brad_frost
178
9.7k
Visualization
eitanlees
146
16k
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 ?>