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
74
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
350
Rapid Application Development with Symfony Framework
redecs
1
150
Making Emails Suck Less
redecs
0
53
Managing your code with Composer and Satis
redecs
0
110
Snapper.VU @ Fearless Conference 2015 - Romania
redecs
0
72
Other Decks in Programming
See All in Programming
Cloud RunとCloud PubSubでサーバレスなデータ基盤2024 with Terraform / Cloud Run and PubSub with Terraform
shinyorke
7
1.9k
決断するための勇気、そのためのBacklog / Courage to make decisions, Backlog for that.
seike460
PRO
4
1.9k
[スクリプト] Swiftの型推論を学ぼう
omochi
0
110
オブジェクト指向は必要なのか / Is object-oriented needed?
kishida
27
19k
PHP 8.3で追加されたjson_validate()を徹底的に深掘りしてみよう
mashirou1234
1
720
Go1.22からの疑似乱数生成器について/go-122-pseudo-random-generator
convto
1
160
Crafting a Own PHP - ウキウキ手作りミニマリストPHP
uzulla
4
1.1k
Deep Dive 大規模システムアーキテクチャ/開発組織エンジニアリング / Deep Dive Large-Scale System Architecture, Development Organization Engineering
nrslib
15
2.9k
Parallel Socket Communication in Swift
s_shimotori
0
220
オブジェクト指向コードレビューの新しいアプローチ
akkie76
3
1.5k
CircleCIを活用して AWSへの継続的デリバリーを 実践する
coconala_engineer
1
100
品質とスピードを両立: TypeScriptの柔軟な型システムをバックエンドで活用する
kosui
4
890
Featured
See All Featured
RailsConf 2023
tenderlove
0
510
Adopting Sorbet at Scale
ufuk
66
8.5k
Reflections from 52 weeks, 52 projects
jeffersonlam
343
19k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
225
51k
Fantastic passwords and where to find them - at NoRuKo
philnash
35
2.4k
KATA
mclloyd
14
11k
Making Projects Easy
brettharned
106
5.4k
Designing for Performance
lara
601
67k
What's in a price? How to price your products and services
michaelherold
236
11k
Bash Introduction
62gerente
604
210k
How STYLIGHT went responsive
nonsquared
92
4.7k
BBQ
matthewcrist
78
8.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 ?>