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
Introduction to PHP 7
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Paul McBride
February 05, 2016
Technology
1
89
Introduction to PHP 7
A short presentation highlighting the new and removed features of PHP 7
Paul McBride
February 05, 2016
Tweet
Share
More Decks by Paul McBride
See All by Paul McBride
An Introduction to React Hooks
thepaulmcbride
0
48
Lessons Learned as a Self-taught Developer
thepaulmcbride
0
41
Other Decks in Technology
See All in Technology
SRE NEXT 2026 CfP レビュアーが語る聞きたくなるプロポーザルとは?
yutakawasaki0911
1
420
頼れる Agentic AI を支える Datadog のオブザーバビリティ / Powering Reliable Agentic AI with Datadog Observability
aoto
PRO
0
200
Go 1.26 Genericsにおける再帰的型制約 / Recursive Type Constraints in Go 1.26 Generics
ryokotmng
0
120
Kiro Powers 入門
k_adachi_01
0
110
Cortex Code CLI と一緒に進めるAgentic Data Engineering
__allllllllez__
0
420
スクリプトの先へ!AIエージェントと組み合わせる モバイルE2Eテスト
error96num
0
180
わからなくて良いなら、わからなきゃだめなの?
kotaoue
1
370
GCASアップデート(202601-202603)
techniczna
0
210
2026-03-11 JAWS-UG 茨城 #12 改めてALBを便利に使う
masasuzu
2
400
決済サービスを支えるElastic Cloud - Elastic Cloudの導入と推進、決済サービスのObservability
suzukij
2
660
Google系サービスで文字起こしから勝手にカレンダーを埋めるエージェントを作った話
risatube
0
190
フロントエンド刷新 4年間の軌跡
yotahada3
0
490
Featured
See All Featured
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
440
My Coaching Mixtape
mlcsv
0
76
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.1k
Between Models and Reality
mayunak
2
240
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
74
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
The browser strikes back
jonoalderson
0
810
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
240
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
120
Discover your Explorer Soul
emna__ayadi
2
1.1k
Transcript
Introduction to PHP 7 PAUL MCBRIDE @pmcbride446
OVERVIEW ̣ History of PHP ̣ Whats new in PHP
7 ̣ Removed and deprecated features ̣ References ̣ Questions
History of PHP Jun 1995 Released by Rasmus Lerdorf Jun
1998 PHP 3 Released May 2000 PHP 4 Released
Jul 2004 PHP 5 Released 2005 Work starts on PHP
6 May 2003 Wordpress 1.0
Dec 2015 PHP 7 Released Mar 2010 PHP 6 is
abandoned Feb 2016 Paul gives a great talk on PHP 7
New Features
SCALAR TYPE DECLARATIONS <?php function greeting(string $name) { return
"Hello, {$name}"; } ̣ String ̣ Integer ̣ Float ̣ Boolean New types
RETURN TYPES <?php declare(strict_types=1); function sum($a, $b): int
{ return $a + $b; } echo sum(1, 5.5);
NULL COALESCING OPERATOR <?php // Pre PHP 7 $username
= isset($_GET['user']) ? $_GET['user'] : 'nobody'; <?php $username = $_GET['user'] ?? 'nobody'; <?php $username = $_GET['user'] ?? $_POST['user'] ?? 'nobody';
None
SPACESHIP OPERATOR <?php // Integers echo 1 <=> 1;
// 0 echo 1 <=> 2; // -1 echo 2 <=> 1; // 1 // Floats echo 1.5 <=> 1.5; // 0 echo 1.5 <=> 2.5; // -1 echo 2.5 <=> 1.5; // 1 // Strings echo "a" <=> "a"; // 0 echo "a" <=> "b"; // -1 echo "b" <=> "a"; // 1
CONSTANT ARRAYS <?php define('ANIMALS', [ 'dog', 'cat', 'bird' ]);
echo ANIMALS[1]; // outputs "cat" Arrays can now now be defined using define()
ANONYMOUS CLASSES <?php new class { public function log(string
$message) { echo $message; } };
GROUP USE DECLARATIONS <?php // Pre PHP 7 code
use some\namespace\ClassA; use some\namespace\ClassB; use some\namespace\ClassC as C; <?php // PHP 7+ code use some\namespace\{ClassA, ClassB, ClassC as C};
PERFORMANCE
PERFORMANCE
OTHER FEATURES ̣ Better unicode support ̣ Integer division with
intdiv() ̣ Improved error handling ̣ Session_start() can now take an options array ̣ unserialize() filter ̣ CSPRNG Functions
DEPRECATED/REMOVED FEATURES
REMOVED FEATURES ereg_* ̣ ASP-style tags ̣ PHP script tags
̣ All functions ̣ The mysql extension (and the functions) <% <%= %> <script language=”php”> mysql_*
DEPRECATED FEATURES ̣ PHP 4 style constructors ̣ Static calls
to non-static methods ̣ Salt option for password_hash()
REFERENCES ̣ http://php.net ̣ https://www.digitalocean.com/company/blog/ getting-ready-for-php-7/
QUESTIONS?
THANKS FOR LISTENING! PAUL MCBRIDE @pmcbride446 joind.in/16983