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
80
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
Cancel Next.js Page Navigation: Full Throttle
ypresto
1
230
空間の中でアイドルとレッスンする技術 - 1st "Vision" / Spatial Lesson technologies with my idol - 1st "Vision"
banjun
PRO
0
220
複数プロダクトの技術改善・クラウド移行に向き合うチームのフレキシブルなペア・モブプログラミングの実践 / Flexible Pair Programming And Mob Programming
honyanya
0
250
RDBの世界をぬりかえていくモデルグラフDB〜truncus graphによるモデルファースト開発〜
jurabi
0
180
色んなオートローダーを覗き見る #phpcon_okinawa
o0h
PRO
5
420
perl for shell, awk and sed programmers
mackee
2
860
Integrating AI in Your Enterprise Java Applications
ivargrimstad
0
530
ML-прайсинг_на_Lamoda__вошли_и_вышли__приключение_на_20_минут__Слава_Цыганков.pdf
lamodatech
0
330
Програмиране с Rust, ФМИ, 2024
nikolads
0
120
現場から考えるソフトウェアエンジニアリングの価値と実験
nomuson
1
140
DjangoNinjaで高速なAPI開発を実現する
masaya00
1
560
tsconfig.jsonの最近の新機能 ファイルパス編
uhyo
7
1.8k
Featured
See All Featured
Debugging Ruby Performance
tmm1
73
12k
YesSQL, Process and Tooling at Scale
rocio
167
14k
The Power of CSS Pseudo Elements
geoffreycrofte
71
5.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Bash Introduction
62gerente
608
210k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.8k
Designing Experiences People Love
moore
138
23k
Robots, Beer and Maslow
schacon
PRO
157
8.2k
Scaling GitHub
holman
458
140k
Facilitating Awesome Meetings
lara
49
6k
The Art of Programming - Codeland 2020
erikaheidi
51
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
•
[email protected]
• https://twiter.com/redecs • https://facebook.com/redecs Mihai
Nica ?>