SlideShare una empresa de Scribd logo
1 de 23
John Coggeshall
@coogle
http://www.coggeshall.org/
A PEEK AT PHP 7.0
WELCOME!
• The CV
• PHP Core contributor (author of ext/tidy)
• PHP Developer since 96’
• Published lots of things
• Spoken lots of places
Melted Metal!
Love the boat!
ALL THE THINGS : PHP 7
• PHP 7 is the next major iteration of the PHP language
• Awesome new language features
• More sanity / consistency
• More speed!
• But wait, what happened to PHP 6?
• PHP 6 is dead.
• The short version: PHP 6’s big push was going to be Unicode support, but there
wasn’t enough developers to get that done so the tree stagnated and died.
• When will PHP 7 be released?
• Best guess: GA Fall, 2015
Warning
Everything I say here could be wrong.
… It’s probably not
… A lot of it is already implemented
… I probably got the date wrong
… There aren’t RFCs for everything
… At least I didn’t write a book on PHP 6
ERROR HANDLING
THE DEATH OF E_STRICT
• E_STRICT was our way of telling developers they were doing it wrong ™
• In PHP 7, E_STRICT is gone, and anything that was E_STRICT has been upgraded to
one of the following:
• Nothing (we just removed the E_STRICT error because it was dumb)
• Make it an E_DEPRECATED error (probably should have ran with this from the
beginning)
• Promote it to an E_NOTICE or E_WARNING (we’re serious about not letting you do
these things, knock it off)
Oh, Yeah! Hell, No.
28 4
https://wiki.php.net/rfc/reclassify_e_strict
CALL TO MEMBER FUNCTION OF
…ARG!!
• A really common error in PHP 5+ is “Call to member function blah() of non object”
• Basically, you tried to call a method on something that wasn’t an object (typically
NULL)
• $foo->bar->baz();
• In PHP 5, this is a fatal error and your application blows up
• In PHP 7 this has been changed to an E_RECOVERABLE_ERROR making it something
you can, you know, recover from in your application
Oh, Yeah! Hell, No.
32 0
https://wiki.php.net/rfc/catchable-call-to-member-of-
non-object
ENGINE EXCEPTIONS
• PHP 7 introduces the concept of using Exceptions for engine-level error handling to
replace E_ERROR, etc.
• Many / Most common error conditions will be converted to exceptions
• Future error conditions will, if possible, be implemented as exceptions
• Also introduced a revamped Exception object model
• BaseException
• EngineException
• ParseException
• Exception
• …
• Note: Existing catch code will not catch these new exceptions (clever)
Oh, Yeah! Hell, No.
60 2
Oh, Yeah! Hell, No.
39 19
https://wiki.php.net/rfc/engine_exceptions_for_php7
OBJECTS ‘N STUFF
WAIT.. THIS WAS BROKEN??
• In current versions of PHP, some internal classes could fail in the constructor and return a
object that, for all intensive purposes, was broken.
• In PHP 7, all internal classes throw exceptions in their constructors to prevent broken
instances
<?php
// Reflection function is not meant to accept an array (E_WARNING)
$reflection = new ReflectionFunction([]);
// Blows up
var_dump($reflection->getParameters());
Oh, Yeah! Hell, No.
32 1
https://wiki.php.net/rfc/internal_constructor_behaviour
SPEAKING OF CONSTRUCTORS..
• Also in PHP 7, the PHP 4 (circa 2000 – 15 years old) style of object constructors having
the same name as the class are one step closer to dying to the relief of all serious
developers.
• Methods named the same thing as the class (i.e. Filter::filter()) are just methods now
• Constructors are called __construct()
• In PHP 7 if it looks like you are using this horrible behavior it will now yell at you with an
E_DEPRECIATED
Oh, Yeah! Hell, No.
50 4
https://wiki.php.net/rfc/remove_php4_constructors
SIMPLIFIED USE STATEMENTS
• In PHP 7 we have added the notion of use statement “groups”
• Cleans up the top of our scripts
use FooBarClassA;
use FooBarClassB;
use FooBarClassC;
use FooBar{ClassA, ClassB, ClassC};
https://wiki.php.net/rfc/group_use_declarations
Oh, Yeah! Hell, No.
39 19
LANGUAGE FEATURES
SPACESHIPS!
https://wiki.php.net/rfc/combined-comparison-operator
• PHP 7 Introduces the “Combined Comparison Operator” (a.k.a. the Spaceship operator)
Operator <=> Equivalent
$a < $b ( $a <=> $b) === -1
$a <= $b ($a <=> $b) === -1 || ($a <=> $b) === 0
$a == $b ($a <=> $b) === 0
$a != $b ($a <=> $b) !== 0
$a >= $b ($a <=> $b) === 1 || ($a <=> $b) === 0
$a > $b ($a <=> $b) === 1
Oh, Yeah! Hell, No.
43 11
?? OPERATOR
• No, that wasn’t a placeholder in my slides
• The ?? Operator, or Null Coalesce Operator which allows us to set default values for
variables when the variable doesn’t exist.
• Cleaner than trying to use ?: or other approaches
https://wiki.php.net/rfc/isset_ternary
Oh, Yeah! Hell, No.
31 3
<?php
// Useful for when you want to set default values for variables
$user = $_GET[‘user’] ?? ‘nobody’;
RETURN TYPES
• My personal war over the years has included this one
• Return type-hints will finally be part of PHP in PHP 7
• Doesn’t support “nullable” types (yet)
<?php
// Useful for when you want to set default values for variables
function returnsArray(): array {
return [‘happy’, ‘days’];
}
Oh, Yeah! Hell, No.
47 3
https://wiki.php.net/rfc/return_types
UNIFORM VARIABLE SYNTAX
• PHP has some… complicated|odd|dumb|insane variable syntax possibilities
• $foo->$bar[‘baz’]()
• There are a lot of inconsistencies in the way we resolve variables when they get a little
crazy
• In PHP 7, we are introducing a uniform syntax and fixing all of those issues
https://wiki.php.net/rfc/uniform_variable_syntax
Oh, Yeah! Hell, No.
30 1
<?php
$foo()[‘bar’](); // Call closure in array from return value
[$obj1, $obj2][0]->prop; // Access $obj1->prop
returnString(){0}; // Return first character
$foo::$bar::$baz; // Stacked static calls
$foo->bar()::baz(); // Stacked mixed calls
$foo()(); // Stacked function calls
$foo->bar()(); // Stacked method calls
WE STILL HAD THAT?
• Arcane open tags for PHP scripts are no longer supported in PHP 7
• ASP-style <% %>
• HTML-style <script language=“php”></script>
• Also, Hexadecimal support for “numeric strings” has been removed
• Before: ‘0x01’ == ‘1’ (true)
• Before: (int)’0x01’ == (int)’1’ (false, wtf?)
• Now: ‘0x01’ == ‘1’ (false)
Oh, Yeah! Hell, No.
26 8
Oh, Yeah! Hell, No.
29 0
https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings
https://wiki.php.net/rfc/remove_alternative_php_tags
SCALAR TYPE HINTS
• PHP 7 will have support for scalar type hinting in addition to the already supported
complex-type hinting
• Introduces the notion of declare(strict_types=1) directives
• Per-file directive
• Put at the top of the file, will enforce strict typing of return values
• Caller file counts, not source file
Oh, Yeah! Hell, No.
108 48
https://wiki.php.net/rfc/scalar_type_hints_v5
<?php
declare(strict_types=1);
function add(float $a, float $b) : float {
return $a + $b;
}
add(1, 2); // retval = float(3)
NEW LIST() BEHAVIOR
• The list() statement(?) is a odd thing in PHP used to extract array values into variables
• list($a, $b, $c) = [1, 2, 3]; // $a = 1, $b = 2, $c = 3
• In PHP 7 there are a couple of changes to the behavior
• list() now assigns variables left-to-right instead of right-to left
• list() no longer supports extracting values from strings
<?php
$a = []
list($a[], $a[], $a[]) = [1, 2 ,3];
// OLD: $a = [3, 2, 1];
// NEW: $a = [1, 2, 3];
https://wiki.php.net/rfc/abstract_syntax_tree
https://wiki.php.net/rfc/fix_list_behavior_inconsistency
GO JOHNNY, GO!
• The so-called PHPNG
branch of PHP has been
merged as the basis for
the engine in PHP 7
• Translation: PHP most of
the time is a lot faster than
before
• One step closer to
effective meaningful JIT
for PHP
Oh, Yeah! Hell, No.
47 2
https://wiki.php.net/rfc/phpng
KEEP UP TO DATE WITH THE LATEST
• PHP 7 like all things is going to be a moving target until it is done
• There is a VirtualBox of PHP 7 to toy around with maintained by Rasmus Lerdorf
• https://github.com/rlerdorf/php7dev
• The PHP RFC Wiki is also a great source of more details on everything we’ve discussed
and the things currently being considered
• https://wiki.php.net/rfc
John Coggeshall
@coogle
http://www.coggeshall.org/
THANK YOU / QUESTIONS?

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Streams, sockets and filters oh my!
Streams, sockets and filters oh my!Streams, sockets and filters oh my!
Streams, sockets and filters oh my!
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
 
HHVM and Hack: A quick introduction
HHVM and Hack: A quick introductionHHVM and Hack: A quick introduction
HHVM and Hack: A quick introduction
 
PHP7: Hello World!
PHP7: Hello World!PHP7: Hello World!
PHP7: Hello World!
 
HipHop Virtual Machine
HipHop Virtual MachineHipHop Virtual Machine
HipHop Virtual Machine
 
Introduction to php php++
Introduction to php php++Introduction to php php++
Introduction to php php++
 
Why choose Hack/HHVM over PHP7
Why choose Hack/HHVM over PHP7Why choose Hack/HHVM over PHP7
Why choose Hack/HHVM over PHP7
 
PHP
PHPPHP
PHP
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
PHP - Introduction to PHP
PHP -  Introduction to PHPPHP -  Introduction to PHP
PHP - Introduction to PHP
 
PHP 5.3
PHP 5.3PHP 5.3
PHP 5.3
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Dev traning 2016 basics of PHP
Dev traning 2016   basics of PHPDev traning 2016   basics of PHP
Dev traning 2016 basics of PHP
 
PHP Comprehensive Overview
PHP Comprehensive OverviewPHP Comprehensive Overview
PHP Comprehensive Overview
 
PHP7 is coming
PHP7 is comingPHP7 is coming
PHP7 is coming
 
Perl Moderno
Perl ModernoPerl Moderno
Perl Moderno
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
PHP 良好實踐 (Best Practice)
PHP 良好實踐 (Best Practice)PHP 良好實踐 (Best Practice)
PHP 良好實踐 (Best Practice)
 
Spl in the wild - zendcon2012
Spl in the wild - zendcon2012Spl in the wild - zendcon2012
Spl in the wild - zendcon2012
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 

Similar a Peek at PHP 7

Preparing code for Php 7 workshop
Preparing code for Php 7 workshopPreparing code for Php 7 workshop
Preparing code for Php 7 workshopDamien Seguy
 
Php7 HHVM and co
Php7 HHVM and coPhp7 HHVM and co
Php7 HHVM and coweltling
 
TAKING PHP SERIOUSLY - Keith Adams
TAKING PHP SERIOUSLY - Keith AdamsTAKING PHP SERIOUSLY - Keith Adams
TAKING PHP SERIOUSLY - Keith AdamsHermes Alves
 
Php7 hhvm and co
Php7 hhvm and coPhp7 hhvm and co
Php7 hhvm and coPierre Joye
 
What To Expect From PHP7
What To Expect From PHP7What To Expect From PHP7
What To Expect From PHP7Codemotion
 
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016Codemotion
 
PHP Basics and Demo HackU
PHP Basics and Demo HackUPHP Basics and Demo HackU
PHP Basics and Demo HackUAnshu Prateek
 
Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13DanWooster1
 
Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010Michelangelo van Dam
 
What's new in PHP 7.1
What's new in PHP 7.1What's new in PHP 7.1
What's new in PHP 7.1Simon Jones
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPtutorialsruby
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPtutorialsruby
 
Embrace dynamic PHP
Embrace dynamic PHPEmbrace dynamic PHP
Embrace dynamic PHPPaul Houle
 

Similar a Peek at PHP 7 (20)

Migrating to PHP 7
Migrating to PHP 7Migrating to PHP 7
Migrating to PHP 7
 
Preparing code for Php 7 workshop
Preparing code for Php 7 workshopPreparing code for Php 7 workshop
Preparing code for Php 7 workshop
 
Php7 HHVM and co
Php7 HHVM and coPhp7 HHVM and co
Php7 HHVM and co
 
TAKING PHP SERIOUSLY - Keith Adams
TAKING PHP SERIOUSLY - Keith AdamsTAKING PHP SERIOUSLY - Keith Adams
TAKING PHP SERIOUSLY - Keith Adams
 
Php7 hhvm and co
Php7 hhvm and coPhp7 hhvm and co
Php7 hhvm and co
 
What To Expect From PHP7
What To Expect From PHP7What To Expect From PHP7
What To Expect From PHP7
 
Welcome to hack
Welcome to hackWelcome to hack
Welcome to hack
 
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
PHP Basics and Demo HackU
PHP Basics and Demo HackUPHP Basics and Demo HackU
PHP Basics and Demo HackU
 
Prersentation
PrersentationPrersentation
Prersentation
 
Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13
 
Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010Php Crash Course - Macq Electronique 2010
Php Crash Course - Macq Electronique 2010
 
Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
What's new in PHP 7.1
What's new in PHP 7.1What's new in PHP 7.1
What's new in PHP 7.1
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 
Embrace dynamic PHP
Embrace dynamic PHPEmbrace dynamic PHP
Embrace dynamic PHP
 

Más de John Coggeshall

Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
ZF2 Modules: Events, Services, and of course, modularity
ZF2 Modules: Events, Services, and of course, modularityZF2 Modules: Events, Services, and of course, modularity
ZF2 Modules: Events, Services, and of course, modularityJohn Coggeshall
 
PHP Development for Google Glass using Phass
PHP Development for Google Glass using PhassPHP Development for Google Glass using Phass
PHP Development for Google Glass using PhassJohn Coggeshall
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Development with Vagrant
Development with VagrantDevelopment with Vagrant
Development with VagrantJohn Coggeshall
 
Introduction to Zend Framework 2
Introduction to Zend Framework 2Introduction to Zend Framework 2
Introduction to Zend Framework 2John Coggeshall
 
10 things not to do at a Startup
10 things not to do at a Startup10 things not to do at a Startup
10 things not to do at a StartupJohn Coggeshall
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Building PHP Powered Android Applications
Building PHP Powered Android ApplicationsBuilding PHP Powered Android Applications
Building PHP Powered Android ApplicationsJohn Coggeshall
 
Ria Applications And PHP
Ria Applications And PHPRia Applications And PHP
Ria Applications And PHPJohn Coggeshall
 
Apache Con 2008 Top 10 Mistakes
Apache Con 2008 Top 10 MistakesApache Con 2008 Top 10 Mistakes
Apache Con 2008 Top 10 MistakesJohn Coggeshall
 
Ria Development With Flex And PHP
Ria Development With Flex And PHPRia Development With Flex And PHP
Ria Development With Flex And PHPJohn Coggeshall
 
Top 10 Scalability Mistakes
Top 10 Scalability MistakesTop 10 Scalability Mistakes
Top 10 Scalability MistakesJohn Coggeshall
 
Enterprise PHP: A Case Study
Enterprise PHP: A Case StudyEnterprise PHP: A Case Study
Enterprise PHP: A Case StudyJohn Coggeshall
 
Building Dynamic Web Applications on i5 with PHP
Building Dynamic Web Applications on i5 with PHPBuilding Dynamic Web Applications on i5 with PHP
Building Dynamic Web Applications on i5 with PHPJohn Coggeshall
 
Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5John Coggeshall
 

Más de John Coggeshall (20)

Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
ZF2 Modules: Events, Services, and of course, modularity
ZF2 Modules: Events, Services, and of course, modularityZF2 Modules: Events, Services, and of course, modularity
ZF2 Modules: Events, Services, and of course, modularity
 
PHP Development for Google Glass using Phass
PHP Development for Google Glass using PhassPHP Development for Google Glass using Phass
PHP Development for Google Glass using Phass
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Development with Vagrant
Development with VagrantDevelopment with Vagrant
Development with Vagrant
 
Introduction to Zend Framework 2
Introduction to Zend Framework 2Introduction to Zend Framework 2
Introduction to Zend Framework 2
 
10 things not to do at a Startup
10 things not to do at a Startup10 things not to do at a Startup
10 things not to do at a Startup
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Puppet
PuppetPuppet
Puppet
 
Building PHP Powered Android Applications
Building PHP Powered Android ApplicationsBuilding PHP Powered Android Applications
Building PHP Powered Android Applications
 
Ria Applications And PHP
Ria Applications And PHPRia Applications And PHP
Ria Applications And PHP
 
Beyond the Browser
Beyond the BrowserBeyond the Browser
Beyond the Browser
 
Apache Con 2008 Top 10 Mistakes
Apache Con 2008 Top 10 MistakesApache Con 2008 Top 10 Mistakes
Apache Con 2008 Top 10 Mistakes
 
Ria Development With Flex And PHP
Ria Development With Flex And PHPRia Development With Flex And PHP
Ria Development With Flex And PHP
 
Top 10 Scalability Mistakes
Top 10 Scalability MistakesTop 10 Scalability Mistakes
Top 10 Scalability Mistakes
 
Enterprise PHP: A Case Study
Enterprise PHP: A Case StudyEnterprise PHP: A Case Study
Enterprise PHP: A Case Study
 
Building Dynamic Web Applications on i5 with PHP
Building Dynamic Web Applications on i5 with PHPBuilding Dynamic Web Applications on i5 with PHP
Building Dynamic Web Applications on i5 with PHP
 
PHP Security Basics
PHP Security BasicsPHP Security Basics
PHP Security Basics
 
Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5Migrating from PHP 4 to PHP 5
Migrating from PHP 4 to PHP 5
 
Ajax and PHP
Ajax and PHPAjax and PHP
Ajax and PHP
 

Último

Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 

Último (20)

Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 

Peek at PHP 7

  • 2. WELCOME! • The CV • PHP Core contributor (author of ext/tidy) • PHP Developer since 96’ • Published lots of things • Spoken lots of places Melted Metal! Love the boat!
  • 3. ALL THE THINGS : PHP 7 • PHP 7 is the next major iteration of the PHP language • Awesome new language features • More sanity / consistency • More speed! • But wait, what happened to PHP 6? • PHP 6 is dead. • The short version: PHP 6’s big push was going to be Unicode support, but there wasn’t enough developers to get that done so the tree stagnated and died. • When will PHP 7 be released? • Best guess: GA Fall, 2015
  • 4. Warning Everything I say here could be wrong. … It’s probably not … A lot of it is already implemented … I probably got the date wrong … There aren’t RFCs for everything … At least I didn’t write a book on PHP 6
  • 6. THE DEATH OF E_STRICT • E_STRICT was our way of telling developers they were doing it wrong ™ • In PHP 7, E_STRICT is gone, and anything that was E_STRICT has been upgraded to one of the following: • Nothing (we just removed the E_STRICT error because it was dumb) • Make it an E_DEPRECATED error (probably should have ran with this from the beginning) • Promote it to an E_NOTICE or E_WARNING (we’re serious about not letting you do these things, knock it off) Oh, Yeah! Hell, No. 28 4 https://wiki.php.net/rfc/reclassify_e_strict
  • 7. CALL TO MEMBER FUNCTION OF …ARG!! • A really common error in PHP 5+ is “Call to member function blah() of non object” • Basically, you tried to call a method on something that wasn’t an object (typically NULL) • $foo->bar->baz(); • In PHP 5, this is a fatal error and your application blows up • In PHP 7 this has been changed to an E_RECOVERABLE_ERROR making it something you can, you know, recover from in your application Oh, Yeah! Hell, No. 32 0 https://wiki.php.net/rfc/catchable-call-to-member-of- non-object
  • 8. ENGINE EXCEPTIONS • PHP 7 introduces the concept of using Exceptions for engine-level error handling to replace E_ERROR, etc. • Many / Most common error conditions will be converted to exceptions • Future error conditions will, if possible, be implemented as exceptions • Also introduced a revamped Exception object model • BaseException • EngineException • ParseException • Exception • … • Note: Existing catch code will not catch these new exceptions (clever) Oh, Yeah! Hell, No. 60 2 Oh, Yeah! Hell, No. 39 19 https://wiki.php.net/rfc/engine_exceptions_for_php7
  • 10. WAIT.. THIS WAS BROKEN?? • In current versions of PHP, some internal classes could fail in the constructor and return a object that, for all intensive purposes, was broken. • In PHP 7, all internal classes throw exceptions in their constructors to prevent broken instances <?php // Reflection function is not meant to accept an array (E_WARNING) $reflection = new ReflectionFunction([]); // Blows up var_dump($reflection->getParameters()); Oh, Yeah! Hell, No. 32 1 https://wiki.php.net/rfc/internal_constructor_behaviour
  • 11. SPEAKING OF CONSTRUCTORS.. • Also in PHP 7, the PHP 4 (circa 2000 – 15 years old) style of object constructors having the same name as the class are one step closer to dying to the relief of all serious developers. • Methods named the same thing as the class (i.e. Filter::filter()) are just methods now • Constructors are called __construct() • In PHP 7 if it looks like you are using this horrible behavior it will now yell at you with an E_DEPRECIATED Oh, Yeah! Hell, No. 50 4 https://wiki.php.net/rfc/remove_php4_constructors
  • 12. SIMPLIFIED USE STATEMENTS • In PHP 7 we have added the notion of use statement “groups” • Cleans up the top of our scripts use FooBarClassA; use FooBarClassB; use FooBarClassC; use FooBar{ClassA, ClassB, ClassC}; https://wiki.php.net/rfc/group_use_declarations Oh, Yeah! Hell, No. 39 19
  • 14. SPACESHIPS! https://wiki.php.net/rfc/combined-comparison-operator • PHP 7 Introduces the “Combined Comparison Operator” (a.k.a. the Spaceship operator) Operator <=> Equivalent $a < $b ( $a <=> $b) === -1 $a <= $b ($a <=> $b) === -1 || ($a <=> $b) === 0 $a == $b ($a <=> $b) === 0 $a != $b ($a <=> $b) !== 0 $a >= $b ($a <=> $b) === 1 || ($a <=> $b) === 0 $a > $b ($a <=> $b) === 1 Oh, Yeah! Hell, No. 43 11
  • 15. ?? OPERATOR • No, that wasn’t a placeholder in my slides • The ?? Operator, or Null Coalesce Operator which allows us to set default values for variables when the variable doesn’t exist. • Cleaner than trying to use ?: or other approaches https://wiki.php.net/rfc/isset_ternary Oh, Yeah! Hell, No. 31 3 <?php // Useful for when you want to set default values for variables $user = $_GET[‘user’] ?? ‘nobody’;
  • 16. RETURN TYPES • My personal war over the years has included this one • Return type-hints will finally be part of PHP in PHP 7 • Doesn’t support “nullable” types (yet) <?php // Useful for when you want to set default values for variables function returnsArray(): array { return [‘happy’, ‘days’]; } Oh, Yeah! Hell, No. 47 3 https://wiki.php.net/rfc/return_types
  • 17. UNIFORM VARIABLE SYNTAX • PHP has some… complicated|odd|dumb|insane variable syntax possibilities • $foo->$bar[‘baz’]() • There are a lot of inconsistencies in the way we resolve variables when they get a little crazy • In PHP 7, we are introducing a uniform syntax and fixing all of those issues https://wiki.php.net/rfc/uniform_variable_syntax Oh, Yeah! Hell, No. 30 1 <?php $foo()[‘bar’](); // Call closure in array from return value [$obj1, $obj2][0]->prop; // Access $obj1->prop returnString(){0}; // Return first character $foo::$bar::$baz; // Stacked static calls $foo->bar()::baz(); // Stacked mixed calls $foo()(); // Stacked function calls $foo->bar()(); // Stacked method calls
  • 18. WE STILL HAD THAT? • Arcane open tags for PHP scripts are no longer supported in PHP 7 • ASP-style <% %> • HTML-style <script language=“php”></script> • Also, Hexadecimal support for “numeric strings” has been removed • Before: ‘0x01’ == ‘1’ (true) • Before: (int)’0x01’ == (int)’1’ (false, wtf?) • Now: ‘0x01’ == ‘1’ (false) Oh, Yeah! Hell, No. 26 8 Oh, Yeah! Hell, No. 29 0 https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings https://wiki.php.net/rfc/remove_alternative_php_tags
  • 19. SCALAR TYPE HINTS • PHP 7 will have support for scalar type hinting in addition to the already supported complex-type hinting • Introduces the notion of declare(strict_types=1) directives • Per-file directive • Put at the top of the file, will enforce strict typing of return values • Caller file counts, not source file Oh, Yeah! Hell, No. 108 48 https://wiki.php.net/rfc/scalar_type_hints_v5 <?php declare(strict_types=1); function add(float $a, float $b) : float { return $a + $b; } add(1, 2); // retval = float(3)
  • 20. NEW LIST() BEHAVIOR • The list() statement(?) is a odd thing in PHP used to extract array values into variables • list($a, $b, $c) = [1, 2, 3]; // $a = 1, $b = 2, $c = 3 • In PHP 7 there are a couple of changes to the behavior • list() now assigns variables left-to-right instead of right-to left • list() no longer supports extracting values from strings <?php $a = [] list($a[], $a[], $a[]) = [1, 2 ,3]; // OLD: $a = [3, 2, 1]; // NEW: $a = [1, 2, 3]; https://wiki.php.net/rfc/abstract_syntax_tree https://wiki.php.net/rfc/fix_list_behavior_inconsistency
  • 21. GO JOHNNY, GO! • The so-called PHPNG branch of PHP has been merged as the basis for the engine in PHP 7 • Translation: PHP most of the time is a lot faster than before • One step closer to effective meaningful JIT for PHP Oh, Yeah! Hell, No. 47 2 https://wiki.php.net/rfc/phpng
  • 22. KEEP UP TO DATE WITH THE LATEST • PHP 7 like all things is going to be a moving target until it is done • There is a VirtualBox of PHP 7 to toy around with maintained by Rasmus Lerdorf • https://github.com/rlerdorf/php7dev • The PHP RFC Wiki is also a great source of more details on everything we’ve discussed and the things currently being considered • https://wiki.php.net/rfc