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
Paul McBride
February 05, 2016
Technology
94
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
More Decks by Paul McBride
See All by Paul McBride
An Introduction to React Hooks
thepaulmcbride
0
50
Lessons Learned as a Self-taught Developer
thepaulmcbride
0
44
Other Decks in Technology
See All in Technology
10倍の生産性を実現するAI駆動並列エージェントのすべて
kumaiu
5
1.4k
機械学習を「社会実装」するということ 2026年夏版 / Social Implementation of Machine Learning June 2026 Version
moepy_stats
4
1.6k
2026TECHFRESH畢業分享會 - Lightning Talk - E起 See See : 電商推薦讀心術? 數據說了算
line_developers_tw
PRO
0
850
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
Claude Codeをどのように キャッチアップしているか
oikon48
12
6.4k
中期計画、2回作ってみた ~業務委託と正社員、両方の視点から~
demaecan
1
690
Socrates × Looker 〜セマンティックレイヤーで進化するデータ分析エージェント〜
hanon52_
3
2.2k
RAG を使わないという選択肢
tatsutaka
1
190
自律型AIエージェントは何を破壊するのか
kojira
0
150
失敗を経て、Harness Engineering で 大切にしたいことを考える / Learning from Failure: What Matters in Harness Engineering
bitkey
PRO
1
320
AWSシリコン最前線 〜AI時代のチップ選択を読み解く〜
htokoyo
2
500
2026TECHFRESH畢業分享會 - Lightning Talk - 資料也要 CI/CD? 用 Airbyte 自動化資料同步
line_developers_tw
PRO
0
850
Featured
See All Featured
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.4k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Leo the Paperboy
mayatellez
7
1.8k
GraphQLとの向き合い方2022年版
quramy
50
15k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
160
Navigating Weather and Climate Data
rabernat
0
220
Designing Powerful Visuals for Engaging Learning
tmiket
1
410
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
470
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
200
We Have a Design System, Now What?
morganepeng
55
8.2k
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