SlideShare a Scribd company logo
1 of 43
Download to read offline
PHP 7.3 AND ITS RFC
PHP 7.3 RC 6
PHP Amersfoort - November 2018
AGENDA
• PHP 7.3
• New features
• Incompatibilities
• How to migrate
• RFC
SPEAKER
• Damien Seguy
• Exakat CTO
• Static analysis for PHP
• Ik ben een boterham
PROGRAMM
• 1/8/2018 : Feature freeze
• 2/8/2018 : beta 1
• 13/09/2018 : RC1
• 13/12/2018 : 7.3.0
MAJOR EVOLUTIONS
IMPROVED GARBAGE COLLECTOR
// 20M very many objects
ms GC No GC
php54 16343.75 14306.16
php55 10654.09 6405.13
php56 10113.73 6341.04
php70 2737.26 1963.01
php71 2781.83 1881.48
php72 2281.21 1822.88
php73 2277.11 1733.06
php74 2113.07 1602.64
• 10% slower when
deactivated
• No gain for small
scripts
• More objects, 

more gain
• Most app won't use GC
IMPROVED GARBAGE COLLECTOR
<?php
$a = array();
for ($i = 0; $i < 20001000; $i++) {
    $a[$i] =& $a;
}
$a[] = "xxx";
unset($a);
var_dump(gc_collect_cycles() > 0);
echo "okn";
?>
IMPROVED GARBAGE COLLECTOR
// Some objects (2000)
ms GC No GC
php54 138.82 46.74
php55 90.47 41.35
php56 104.42 50.87
php70 105.29 47.42
php71 185.17 95.66
php72 75.31 72.98
php73 76.07 32.29
php74 70.76 37.39
• 10% slower when
deactivated
• No gain for small
scripts
• More objects, 

more gain
• Most app won't use GC
RELAXED HEREDOC/NOWDOC
<?php
class foo {
public $bar = <<<EOT
bar
EOT;
} <?php
function foo($arg) {
$bar = <<<'EOT'
bar$arg
EOT;
}
RELAXED HEREDOC/NOWDOC
<?php
class foo {
public $bar = <<<EOT
bar
EOT;
}
"bar"
• Tabulations or spaces
• Don't mix them!
RELAXED HEREDOC/NOWDOC
<?php
class foo {
public $bar = <<<EOT
bar
EOT;
}
" bar"
• Trailing comma
• Just like for arrays
• The last element may be empty
• Only applies to the last element
• Valid of methods and functions
• Targets long diffs with your VCS
TRAILING COMMA
foo(
$foo,
$bar,
$baz,
);
NO MORE CASE INSENSITIVE
CONSTANTS
namespace {
define('NSFOO', 42, true); 

// Case insensitive constant
}
 
namespace Test {
use const NSFOO;
var_dump(FOO); // OK
var_dump(foo); // Warning
}
NO MORE CASE INSENSITIVE
CONSTANTS
Case-insensitive constants are deprecated. The
correct casing for this constant is "%s
define(): Declaration of case-insensitive
constants is deprecated
• New errors
NO MORE CASE INSENSITIVE
CONSTANTS
• Conventions are to declare and use constant in
UPPER CASE
• Constants are more and more defined with const, as
class constant, and not with define()
• null, true, false will be keywords in PHP 8
• __FILE__, __LINE__, … Stay case insensitive
• Only functions are case insensitive now…
INFRASTRUCTURE
NEW SQLITE3
• Version 3.24
• Support for UPSERT
• UPSERT = INSERT or UPDATE
• An UPSERT is an ordinary INSERT statement that is
followed by the special ON CONFLICT clause
shown above.
• REPLACE = INSERT or OVERWRITE
NEW PCRE VERSION : 2.0!
• PHP 7.2 uses PCRE1
• PHP 7.3 uses PCRE2
• Lots of new features, little incompatibilities
• Options X and S are no more
• Plus de vérifications à la compilation
MINOR EVOLUTIONS
CONTINUE IS FOR LOOPS
<?php
while ($foo) {
    switch ($bar) {
        case "baz":
            continue; // In PHP: Behaves like "break;"
                      // In C:   Behaves like "continue 2;"
    }
}
?>
`"continue" targeting switch is equivalent to
"break". Did you mean to use "continue 2"?`
JSON_ENCODE RAISE
EXCEPTIONS
• json_encode/json_decode may return NULL , false,
empty string
• How to differentiate between error and valid
result?
• New option : JSON_THROW_ON_ERROR, with its
associate try{ } catch
• A new beginning…
COMPACT() REPORT UNDEFINED
VARIABLES
$foo = 'bar';
 
$baz = compact('foo', 'foz'); 

// Notice: compact(): Undefined variable: foz
NET_GET_INTERFACES()
• List all
available
network
interfaces
• Read system
information
from PHP
Array
(
[lo0] => Array
(
[unicast] => Array
(
[0] => Array
(
[flags] => 32841
[family] => 18
)
[1] => Array
(
[flags] => 32841
[family] => 30
[address] => ::1
[netmask] => ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
)
[2] => Array
(
[flags] => 32841
[family] => 2
[address] => 127.0.0.1
[netmask] => 255.0.0.0
)
[3] => Array
(
[flags] => 32841
[family] => 30
[address] => fe80::1
[netmask] => ffff:ffff:ffff:ffff::
)
)
)
[gif0] => Array
IS_COUNTABLE()
• is_countable() checks a variable may be counted
with count()
• it may be an array or a object with Countable
HRTIME
• HRTIME is a monotonus timer
• Measures time intervals
• No impact from calendar, like microtime() : 

day light saving time, leap seconds…
• It is very precise
• More than microtime()
• Same API from microtime()
SAME SITE COOKIE
• setcookie
• setrawcookie
• session_set_cookie_params
• session_get_cookie_params
void session_set_cookie_params ( int $lifetime 

[, array $options ] )
Set-Cookie: key=value; path=/; domain=example.org;
HttpOnly; SameSite=Lax
LIST() WITH REFERENCE
$array = [1, 2];
list($a, &$b) = $array;
$array = [1, 2];
$a = $array[0];
$b =& $array[1];
LIST() WITH REFERENCE
$array = [[1, 2], [3, 4]];
foreach ($array as list(&$a, $b)) {
$a = 7;
}
var_dump($array)
REMOVED FEATURES
• image2wbmp
• but imagefromstring() supports webp
• undocumented mbstring() alias
• No more function assert()
• Search in a string with integers
FIRST KEY IN AN ARRAY
// usage of an associative array
$array = ['a' => 1, 'b' => 2, 'c' => 3];
LAST KEY IN AN ARRAY
// usage of an associative array
$array = ['a' => 1, 'b' => 2, 'c' => 3];
 
$firstKey = array_keys($array)[0];
$lastKey = array_keys($array)[count($array) - 1];
ARRAY_KEY_LAST,
ARRAY_KEY_FIRST
// usage of an associative array
$array = ['a' => 1, 'b' => 2, 'c' => 3];
 
$firstKey = array_key_first($array);
$lastKey = array_key_last($array);
 
assert($firstKey === 'a');
assert($lastKey === 'c');
VARIOUS
• No more support for BeOS
• FILTER_SANITIZE_ADD_SLASHES
RFC
RFC : HOW DOES IT WORK?
RFC : HOW DOES IT WORK?
• Under Discussion
• In draft
• Pending Implementation
• For PHP 8.0
• PHP 7.3
• PHP 7.2…
RFC : COMMENT CA MARCHE
• Under Discussion
• In draft
• Pending Implementation
• For PHP 8.0
• PHP 7.3
• PHP 7.2…
BEDANKT!
@EXAKAT - HTTP://WWW.EXAKAT.IO/

More Related Content

What's hot

Wrangling WP_Cron - WordCamp Grand Rapids 2014
Wrangling WP_Cron - WordCamp Grand Rapids 2014Wrangling WP_Cron - WordCamp Grand Rapids 2014
Wrangling WP_Cron - WordCamp Grand Rapids 2014cklosowski
 
PHP Nedir? Ne yapabiliriz?
PHP Nedir? Ne yapabiliriz?PHP Nedir? Ne yapabiliriz?
PHP Nedir? Ne yapabiliriz?Hüseyin Mert
 
HomeKit Inside And Out
HomeKit Inside And OutHomeKit Inside And Out
HomeKit Inside And OutRolf Rando
 
How Danga::Socket handles asynchronous processing and how to write asynchrono...
How Danga::Socket handles asynchronous processing and how to write asynchrono...How Danga::Socket handles asynchronous processing and how to write asynchrono...
How Danga::Socket handles asynchronous processing and how to write asynchrono...Gosuke Miyashita
 
Get your ass to 1.9
Get your ass to 1.9Get your ass to 1.9
Get your ass to 1.9Nic Benders
 
From Web Developer to Hardware Developer
From Web Developer to Hardware DeveloperFrom Web Developer to Hardware Developer
From Web Developer to Hardware Developeralexshenoy
 
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Hitesh Mohapatra
 
How we migrated Zalando app to Swift3?
How we migrated Zalando app to Swift3?How we migrated Zalando app to Swift3?
How we migrated Zalando app to Swift3?Vijaya Prakash Kandel
 
NSLogger network logging extension
NSLogger network logging extensionNSLogger network logging extension
NSLogger network logging extensionCocoaHeads France
 
Services Apps Iand Flex Applications
Services Apps Iand Flex ApplicationsServices Apps Iand Flex Applications
Services Apps Iand Flex ApplicationsSumit Kataria
 
Como construir uma Aplicação que consuma e produza updates no Twitter usando ...
Como construir uma Aplicação que consuma e produza updates no Twitter usando ...Como construir uma Aplicação que consuma e produza updates no Twitter usando ...
Como construir uma Aplicação que consuma e produza updates no Twitter usando ...Cirdes Filho
 
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir MeetupCachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir MeetupAbel Muíño
 
Serverless Ballerina
Serverless BallerinaServerless Ballerina
Serverless BallerinaBallerina
 
CouchDB: A NoSQL database
CouchDB: A NoSQL databaseCouchDB: A NoSQL database
CouchDB: A NoSQL databaseRubyc Slides
 
DIG1108C Lesson3 Fall 2014
DIG1108C Lesson3 Fall 2014DIG1108C Lesson3 Fall 2014
DIG1108C Lesson3 Fall 2014David Wolfpaw
 

What's hot (20)

Wrangling WP_Cron - WordCamp Grand Rapids 2014
Wrangling WP_Cron - WordCamp Grand Rapids 2014Wrangling WP_Cron - WordCamp Grand Rapids 2014
Wrangling WP_Cron - WordCamp Grand Rapids 2014
 
PHP Nedir? Ne yapabiliriz?
PHP Nedir? Ne yapabiliriz?PHP Nedir? Ne yapabiliriz?
PHP Nedir? Ne yapabiliriz?
 
HomeKit Inside And Out
HomeKit Inside And OutHomeKit Inside And Out
HomeKit Inside And Out
 
How Danga::Socket handles asynchronous processing and how to write asynchrono...
How Danga::Socket handles asynchronous processing and how to write asynchrono...How Danga::Socket handles asynchronous processing and how to write asynchrono...
How Danga::Socket handles asynchronous processing and how to write asynchrono...
 
Get your ass to 1.9
Get your ass to 1.9Get your ass to 1.9
Get your ass to 1.9
 
OHHttpStubs
OHHttpStubsOHHttpStubs
OHHttpStubs
 
From Web Developer to Hardware Developer
From Web Developer to Hardware DeveloperFrom Web Developer to Hardware Developer
From Web Developer to Hardware Developer
 
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...
 
How we migrated Zalando app to Swift3?
How we migrated Zalando app to Swift3?How we migrated Zalando app to Swift3?
How we migrated Zalando app to Swift3?
 
NSLogger network logging extension
NSLogger network logging extensionNSLogger network logging extension
NSLogger network logging extension
 
Services Apps Iand Flex Applications
Services Apps Iand Flex ApplicationsServices Apps Iand Flex Applications
Services Apps Iand Flex Applications
 
Como construir uma Aplicação que consuma e produza updates no Twitter usando ...
Como construir uma Aplicação que consuma e produza updates no Twitter usando ...Como construir uma Aplicação que consuma e produza updates no Twitter usando ...
Como construir uma Aplicação que consuma e produza updates no Twitter usando ...
 
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir MeetupCachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
 
symfony & jQuery (phpDay)
symfony & jQuery (phpDay)symfony & jQuery (phpDay)
symfony & jQuery (phpDay)
 
Sftplite
SftpliteSftplite
Sftplite
 
Less
LessLess
Less
 
Serverless Ballerina
Serverless BallerinaServerless Ballerina
Serverless Ballerina
 
CouchDB: A NoSQL database
CouchDB: A NoSQL databaseCouchDB: A NoSQL database
CouchDB: A NoSQL database
 
Mojo as a_client
Mojo as a_clientMojo as a_client
Mojo as a_client
 
DIG1108C Lesson3 Fall 2014
DIG1108C Lesson3 Fall 2014DIG1108C Lesson3 Fall 2014
DIG1108C Lesson3 Fall 2014
 

Similar to Everything new with PHP 7.3

A brief to PHP 7.3
A brief to PHP 7.3A brief to PHP 7.3
A brief to PHP 7.3Xinchen Hui
 
CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011Graham Weldon
 
Resting with OroCRM Webinar
Resting with OroCRM WebinarResting with OroCRM Webinar
Resting with OroCRM WebinarOro Inc.
 
LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017Matthew Beale
 
Building an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkBuilding an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkChristopher Foresman
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek PROIDEA
 
Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackJakub Hajek
 
Damien seguy php 5.6
Damien seguy php 5.6Damien seguy php 5.6
Damien seguy php 5.6Damien Seguy
 
Building a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationBuilding a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationJonathan Katz
 
Framework and Application Benchmarking
Framework and Application BenchmarkingFramework and Application Benchmarking
Framework and Application BenchmarkingPaul Jones
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsTristan Gomez
 
PHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacyPHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacyDamien Seguy
 
05 integrate redis
05 integrate redis05 integrate redis
05 integrate redisErhwen Kuo
 
Redis modules 101
Redis modules 101Redis modules 101
Redis modules 101Dvir Volk
 

Similar to Everything new with PHP 7.3 (20)

A brief to PHP 7.3
A brief to PHP 7.3A brief to PHP 7.3
A brief to PHP 7.3
 
Intro to CakePHP
Intro to CakePHPIntro to CakePHP
Intro to CakePHP
 
CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011
 
Resting with OroCRM Webinar
Resting with OroCRM WebinarResting with OroCRM Webinar
Resting with OroCRM Webinar
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017
 
Building an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkBuilding an API with Django and Django REST Framework
Building an API with Django and Django REST Framework
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek
 
Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic Stack
 
Damien seguy php 5.6
Damien seguy php 5.6Damien seguy php 5.6
Damien seguy php 5.6
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 
Building a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationBuilding a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management Application
 
Framework and Application Benchmarking
Framework and Application BenchmarkingFramework and Application Benchmarking
Framework and Application Benchmarking
 
PostgreSQL
PostgreSQLPostgreSQL
PostgreSQL
 
Refactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and PatternsRefactoring @ Mindvalley: Smells, Techniques and Patterns
Refactoring @ Mindvalley: Smells, Techniques and Patterns
 
PHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacyPHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacy
 
05 integrate redis
05 integrate redis05 integrate redis
05 integrate redis
 
Redis modules 101
Redis modules 101Redis modules 101
Redis modules 101
 
Monitoring your API
Monitoring your APIMonitoring your API
Monitoring your API
 

More from Damien Seguy

Strong typing @ php leeds
Strong typing  @ php leedsStrong typing  @ php leeds
Strong typing @ php leedsDamien Seguy
 
Strong typing : adoption, adaptation and organisation
Strong typing : adoption, adaptation and organisationStrong typing : adoption, adaptation and organisation
Strong typing : adoption, adaptation and organisationDamien Seguy
 
Qui a laissé son mot de passe dans le code
Qui a laissé son mot de passe dans le codeQui a laissé son mot de passe dans le code
Qui a laissé son mot de passe dans le codeDamien Seguy
 
Analyse statique et applications
Analyse statique et applicationsAnalyse statique et applications
Analyse statique et applicationsDamien Seguy
 
Top 10 pieges php afup limoges
Top 10 pieges php   afup limogesTop 10 pieges php   afup limoges
Top 10 pieges php afup limogesDamien Seguy
 
Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020Damien Seguy
 
Meilleur du typage fort (AFUP Day, 2020)
Meilleur du typage fort (AFUP Day, 2020)Meilleur du typage fort (AFUP Day, 2020)
Meilleur du typage fort (AFUP Day, 2020)Damien Seguy
 
Top 10 php classic traps confoo
Top 10 php classic traps confooTop 10 php classic traps confoo
Top 10 php classic traps confooDamien Seguy
 
Tout pour se préparer à PHP 7.4
Tout pour se préparer à PHP 7.4Tout pour se préparer à PHP 7.4
Tout pour se préparer à PHP 7.4Damien Seguy
 
Top 10 php classic traps php serbia
Top 10 php classic traps php serbiaTop 10 php classic traps php serbia
Top 10 php classic traps php serbiaDamien Seguy
 
Top 10 php classic traps
Top 10 php classic trapsTop 10 php classic traps
Top 10 php classic trapsDamien Seguy
 
Top 10 chausse trappes
Top 10 chausse trappesTop 10 chausse trappes
Top 10 chausse trappesDamien Seguy
 
Code review workshop
Code review workshopCode review workshop
Code review workshopDamien Seguy
 
Understanding static analysis php amsterdam 2018
Understanding static analysis   php amsterdam 2018Understanding static analysis   php amsterdam 2018
Understanding static analysis php amsterdam 2018Damien Seguy
 
Review unknown code with static analysis php ce 2018
Review unknown code with static analysis   php ce 2018Review unknown code with static analysis   php ce 2018
Review unknown code with static analysis php ce 2018Damien Seguy
 
Php 7.3 et ses RFC (AFUP Toulouse)
Php 7.3 et ses RFC  (AFUP Toulouse)Php 7.3 et ses RFC  (AFUP Toulouse)
Php 7.3 et ses RFC (AFUP Toulouse)Damien Seguy
 
Tout sur PHP 7.3 et ses RFC
Tout sur PHP 7.3 et ses RFCTout sur PHP 7.3 et ses RFC
Tout sur PHP 7.3 et ses RFCDamien Seguy
 
Review unknown code with static analysis php ipc 2018
Review unknown code with static analysis   php ipc 2018Review unknown code with static analysis   php ipc 2018
Review unknown code with static analysis php ipc 2018Damien Seguy
 
Code review for busy people
Code review for busy peopleCode review for busy people
Code review for busy peopleDamien Seguy
 
Static analysis saved my code tonight
Static analysis saved my code tonightStatic analysis saved my code tonight
Static analysis saved my code tonightDamien Seguy
 

More from Damien Seguy (20)

Strong typing @ php leeds
Strong typing  @ php leedsStrong typing  @ php leeds
Strong typing @ php leeds
 
Strong typing : adoption, adaptation and organisation
Strong typing : adoption, adaptation and organisationStrong typing : adoption, adaptation and organisation
Strong typing : adoption, adaptation and organisation
 
Qui a laissé son mot de passe dans le code
Qui a laissé son mot de passe dans le codeQui a laissé son mot de passe dans le code
Qui a laissé son mot de passe dans le code
 
Analyse statique et applications
Analyse statique et applicationsAnalyse statique et applications
Analyse statique et applications
 
Top 10 pieges php afup limoges
Top 10 pieges php   afup limogesTop 10 pieges php   afup limoges
Top 10 pieges php afup limoges
 
Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020
 
Meilleur du typage fort (AFUP Day, 2020)
Meilleur du typage fort (AFUP Day, 2020)Meilleur du typage fort (AFUP Day, 2020)
Meilleur du typage fort (AFUP Day, 2020)
 
Top 10 php classic traps confoo
Top 10 php classic traps confooTop 10 php classic traps confoo
Top 10 php classic traps confoo
 
Tout pour se préparer à PHP 7.4
Tout pour se préparer à PHP 7.4Tout pour se préparer à PHP 7.4
Tout pour se préparer à PHP 7.4
 
Top 10 php classic traps php serbia
Top 10 php classic traps php serbiaTop 10 php classic traps php serbia
Top 10 php classic traps php serbia
 
Top 10 php classic traps
Top 10 php classic trapsTop 10 php classic traps
Top 10 php classic traps
 
Top 10 chausse trappes
Top 10 chausse trappesTop 10 chausse trappes
Top 10 chausse trappes
 
Code review workshop
Code review workshopCode review workshop
Code review workshop
 
Understanding static analysis php amsterdam 2018
Understanding static analysis   php amsterdam 2018Understanding static analysis   php amsterdam 2018
Understanding static analysis php amsterdam 2018
 
Review unknown code with static analysis php ce 2018
Review unknown code with static analysis   php ce 2018Review unknown code with static analysis   php ce 2018
Review unknown code with static analysis php ce 2018
 
Php 7.3 et ses RFC (AFUP Toulouse)
Php 7.3 et ses RFC  (AFUP Toulouse)Php 7.3 et ses RFC  (AFUP Toulouse)
Php 7.3 et ses RFC (AFUP Toulouse)
 
Tout sur PHP 7.3 et ses RFC
Tout sur PHP 7.3 et ses RFCTout sur PHP 7.3 et ses RFC
Tout sur PHP 7.3 et ses RFC
 
Review unknown code with static analysis php ipc 2018
Review unknown code with static analysis   php ipc 2018Review unknown code with static analysis   php ipc 2018
Review unknown code with static analysis php ipc 2018
 
Code review for busy people
Code review for busy peopleCode review for busy people
Code review for busy people
 
Static analysis saved my code tonight
Static analysis saved my code tonightStatic analysis saved my code tonight
Static analysis saved my code tonight
 

Recently uploaded

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Everything new with PHP 7.3

  • 1. PHP 7.3 AND ITS RFC PHP 7.3 RC 6 PHP Amersfoort - November 2018
  • 2. AGENDA • PHP 7.3 • New features • Incompatibilities • How to migrate • RFC
  • 3. SPEAKER • Damien Seguy • Exakat CTO • Static analysis for PHP • Ik ben een boterham
  • 4. PROGRAMM • 1/8/2018 : Feature freeze • 2/8/2018 : beta 1 • 13/09/2018 : RC1 • 13/12/2018 : 7.3.0
  • 6. IMPROVED GARBAGE COLLECTOR // 20M very many objects ms GC No GC php54 16343.75 14306.16 php55 10654.09 6405.13 php56 10113.73 6341.04 php70 2737.26 1963.01 php71 2781.83 1881.48 php72 2281.21 1822.88 php73 2277.11 1733.06 php74 2113.07 1602.64 • 10% slower when deactivated • No gain for small scripts • More objects, 
 more gain • Most app won't use GC
  • 8. IMPROVED GARBAGE COLLECTOR // Some objects (2000) ms GC No GC php54 138.82 46.74 php55 90.47 41.35 php56 104.42 50.87 php70 105.29 47.42 php71 185.17 95.66 php72 75.31 72.98 php73 76.07 32.29 php74 70.76 37.39 • 10% slower when deactivated • No gain for small scripts • More objects, 
 more gain • Most app won't use GC
  • 9. RELAXED HEREDOC/NOWDOC <?php class foo { public $bar = <<<EOT bar EOT; } <?php function foo($arg) { $bar = <<<'EOT' bar$arg EOT; }
  • 10. RELAXED HEREDOC/NOWDOC <?php class foo { public $bar = <<<EOT bar EOT; } "bar"
  • 11. • Tabulations or spaces • Don't mix them! RELAXED HEREDOC/NOWDOC <?php class foo { public $bar = <<<EOT bar EOT; } " bar"
  • 12. • Trailing comma • Just like for arrays • The last element may be empty • Only applies to the last element • Valid of methods and functions • Targets long diffs with your VCS TRAILING COMMA foo( $foo, $bar, $baz, );
  • 13. NO MORE CASE INSENSITIVE CONSTANTS namespace { define('NSFOO', 42, true); 
 // Case insensitive constant }   namespace Test { use const NSFOO; var_dump(FOO); // OK var_dump(foo); // Warning }
  • 14. NO MORE CASE INSENSITIVE CONSTANTS Case-insensitive constants are deprecated. The correct casing for this constant is "%s define(): Declaration of case-insensitive constants is deprecated • New errors
  • 15. NO MORE CASE INSENSITIVE CONSTANTS • Conventions are to declare and use constant in UPPER CASE • Constants are more and more defined with const, as class constant, and not with define() • null, true, false will be keywords in PHP 8 • __FILE__, __LINE__, … Stay case insensitive • Only functions are case insensitive now…
  • 17. NEW SQLITE3 • Version 3.24 • Support for UPSERT • UPSERT = INSERT or UPDATE • An UPSERT is an ordinary INSERT statement that is followed by the special ON CONFLICT clause shown above. • REPLACE = INSERT or OVERWRITE
  • 18. NEW PCRE VERSION : 2.0! • PHP 7.2 uses PCRE1 • PHP 7.3 uses PCRE2 • Lots of new features, little incompatibilities • Options X and S are no more • Plus de vérifications à la compilation
  • 20. CONTINUE IS FOR LOOPS <?php while ($foo) {     switch ($bar) {         case "baz":             continue; // In PHP: Behaves like "break;"                       // In C:   Behaves like "continue 2;"     } } ?> `"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?`
  • 21. JSON_ENCODE RAISE EXCEPTIONS • json_encode/json_decode may return NULL , false, empty string • How to differentiate between error and valid result? • New option : JSON_THROW_ON_ERROR, with its associate try{ } catch • A new beginning…
  • 22. COMPACT() REPORT UNDEFINED VARIABLES $foo = 'bar';   $baz = compact('foo', 'foz'); 
 // Notice: compact(): Undefined variable: foz
  • 23. NET_GET_INTERFACES() • List all available network interfaces • Read system information from PHP Array ( [lo0] => Array ( [unicast] => Array ( [0] => Array ( [flags] => 32841 [family] => 18 ) [1] => Array ( [flags] => 32841 [family] => 30 [address] => ::1 [netmask] => ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ) [2] => Array ( [flags] => 32841 [family] => 2 [address] => 127.0.0.1 [netmask] => 255.0.0.0 ) [3] => Array ( [flags] => 32841 [family] => 30 [address] => fe80::1 [netmask] => ffff:ffff:ffff:ffff:: ) ) ) [gif0] => Array
  • 24. IS_COUNTABLE() • is_countable() checks a variable may be counted with count() • it may be an array or a object with Countable
  • 25. HRTIME • HRTIME is a monotonus timer • Measures time intervals • No impact from calendar, like microtime() : 
 day light saving time, leap seconds… • It is very precise • More than microtime() • Same API from microtime()
  • 26. SAME SITE COOKIE • setcookie • setrawcookie • session_set_cookie_params • session_get_cookie_params void session_set_cookie_params ( int $lifetime 
 [, array $options ] ) Set-Cookie: key=value; path=/; domain=example.org; HttpOnly; SameSite=Lax
  • 27. LIST() WITH REFERENCE $array = [1, 2]; list($a, &$b) = $array; $array = [1, 2]; $a = $array[0]; $b =& $array[1];
  • 28. LIST() WITH REFERENCE $array = [[1, 2], [3, 4]]; foreach ($array as list(&$a, $b)) { $a = 7; } var_dump($array)
  • 29. REMOVED FEATURES • image2wbmp • but imagefromstring() supports webp • undocumented mbstring() alias • No more function assert() • Search in a string with integers
  • 30. FIRST KEY IN AN ARRAY // usage of an associative array $array = ['a' => 1, 'b' => 2, 'c' => 3];
  • 31. LAST KEY IN AN ARRAY // usage of an associative array $array = ['a' => 1, 'b' => 2, 'c' => 3];   $firstKey = array_keys($array)[0]; $lastKey = array_keys($array)[count($array) - 1];
  • 32. ARRAY_KEY_LAST, ARRAY_KEY_FIRST // usage of an associative array $array = ['a' => 1, 'b' => 2, 'c' => 3];   $firstKey = array_key_first($array); $lastKey = array_key_last($array);   assert($firstKey === 'a'); assert($lastKey === 'c');
  • 33. VARIOUS • No more support for BeOS • FILTER_SANITIZE_ADD_SLASHES
  • 34.
  • 35. RFC
  • 36. RFC : HOW DOES IT WORK?
  • 37. RFC : HOW DOES IT WORK? • Under Discussion • In draft • Pending Implementation • For PHP 8.0 • PHP 7.3 • PHP 7.2…
  • 38. RFC : COMMENT CA MARCHE • Under Discussion • In draft • Pending Implementation • For PHP 8.0 • PHP 7.3 • PHP 7.2…
  • 39.
  • 40.
  • 41.
  • 42.