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
91
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
92
Other Decks in Programming
See All in Programming
ぽちぽち選択するだけでOSSを読めるVSCode拡張機能
ymbigo
14
6.1k
Jakarta EE Meets AI
ivargrimstad
0
860
REALITY コマンド作成チュートリアル
nishiuriraku
0
120
Носок на сок
bo0om
0
1.2k
Optimizing JRuby 10
headius
0
580
状態と共に暮らす:ステートフルへの挑戦
ypresto
3
1.2k
The Missing Link in Angular’s Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
140
flutter_kaigi_mini_4.pdf
nobu74658
0
150
generative-ai-use-cases(GenU)の推しポイント ~2025年4月版~
hideg
1
390
カオスに立ち向かう小規模チームの装備の選択〜フルスタックTSという装備の強み _ 弱み〜/Choosing equipment for a small team facing chaos ~ Strengths and weaknesses of full-stack TS~
bitkey
1
140
KANNA Android の技術的課題と取り組み
watabee
0
210
RuboCop: Modularity and AST Insights
koic
3
2.7k
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
Adopting Sorbet at Scale
ufuk
76
9.4k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
23
2.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
Done Done
chrislema
184
16k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.8k
4 Signs Your Business is Dying
shpigford
183
22k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
Rails Girls Zürich Keynote
gr2m
94
13k
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
• mihai@wisesystems.co • https://twiter.com/redecs • https://facebook.com/redecs Mihai
Nica ?>