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
Paul McBride
February 05, 2016
Technology
100
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
54
Other Decks in Technology
See All in Technology
AIフレンドリーなGenerative UIをJSXで
uhyo
2
310
Test Impact Analysis を武器に立ち向かう、AI 時代のテスト増加に対するヌーラボのアプローチ / getting-started-datadog-test-impact-analysis
k6s4i53rx
3
880
現地速報! Microsoft Ignite アップデートレポート
kasada
1
460
Metadata - Section 4 : MODS (Metadata Object Description Schema )
mohab1
0
140
サーバーラックは作る時代! 3Dプリンターで作る10インチラックのススメ
jacopen
2
520
AWS DevOps Agentの構造から読み解く運用 AI エージェントの設計原則/aws-devops-agent-design-principles
tomoki10
0
290
Libérez Firefox et Thunderbird avec nos astuces
hellosct1
0
200
業務の傍らで進める改善ループエンジニアリング
bengo4com
1
240
クラウドでも使えるNetApp -現場目線での設計とクラウドバックアップの活用
ryutakondo
1
340
Context parameters で作る!はじめての型クラス
kworkdev
PRO
1
180
AWS re:Invent 2026 FSI Pre-Event Networking Night
junjikoide
0
270
認知負荷の減らし方 ~開発にも日常業務にも活かせるノウハウ~
minorun365
PRO
17
11k
Featured
See All Featured
The Mindset for Success: Future Career Progression
greggifford
PRO
0
570
What's in a price? How to price your products and services
michaelherold
247
13k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
610
Git: the NoSQL Database
bkeepers
PRO
433
67k
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
600
Building a Scalable Design System with Sketch
lauravandoore
464
34k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
Navigating Team Friction
lara
192
16k
Site-Speed That Sticks
csswizardry
13
1.6k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
910
Build your cross-platform service in a week with App Engine
jlugia
234
19k