Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introduction to PHP 7
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Paul McBride
February 05, 2016
Technology
98
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to PHP 7
A short presentation highlighting the new and removed features of PHP 7
Paul McBride
February 05, 2016
Transcript
23 slides
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
More Decks by Paul McBride
See All by Paul McBride
An Introduction to React Hooks
thepaulmcbride
0
54
Lessons Learned as a Self-taught Developer
thepaulmcbride
0
51
Other Decks in Technology
See All in Technology
Community Over Code Glasgow 2026 + Lakehouse Day recap
lycorptech_jp
PRO
1
120
速くなった開発の効果をどう推し量るのか
bulbulpaul
0
120
狙われているAPIの脆弱性!今こそ手をつけるべき根本的な対策とは?
nagix
0
140
自動計装なしでECSサービスをApplication Signalsに載せるまで
ota1022
1
160
並列度を下げたら速くなった — go build の重複コンパイルを実測で見る
tomoaki25
2
1.3k
ぼくのClaude Codeの使い方
falken
PRO
5
7.4k
AWS Client VPNの設定でハマったポイントとその過程での気づき
amarelo_n24
0
260
こんなに変わった! AWSネットワークの常識
shotashiratori
13
8.6k
異夢同船〜異なる夢でも同じ船でなんとかする〜
fortegp05
1
460
「任されビリティ」で引き受けて「よしなりてぃ」に頼らず任せる / Accept tasks with "makasarebility" and hand them over without relying on "yoshinarily"
pauli
1
730
マネージャーをエスパーにしない マネジメントされる側から始める、働きやすい現場づくり
comi190327
1
690
Sonnetだけで業務はまわる?
kintotechdev
1
140
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
4
640
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
900
ラッコキーワード サービス紹介資料
rakko
5
5.9M
Unsuck your backbone
ammeep
672
58k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Docker and Python
trallard
47
4.3k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Faster Mobile Websites
deanohume
310
32k
Code Reviewing Like a Champion
maltzj
529
40k