SlideShare ist ein Scribd-Unternehmen logo
1 von 47
$SLIDES_SOURCES = { ‘RASMUS LERDORF’, ‘ZEEV ZURASKI’, ‘JOHN MORRIS’, };
TOPIC
WILLIAM PINAUD
NINJA PROJECT MANAGER & ARCHITECT
SLIDES ♥ AFUP LIMOGES
PHP //
NEW STUFF
AND BEYOND
Q4 2018
08/06/1995 Personal Home Page 1.0 / Forms Interpreter on Usenet
01/11/1997 PHP/FI 2.0
06/06/1998 Ze + nd - PHP: Hypertext Preprocessor - PHP 3.0 - Zend Engine 1.0
22/05/2000 PHP 4.0
14/07/2004 PHP 5.0 - Zend Engine 2.0
2005 > 2010 PHP 6.0 - ICU-based engine (RIP)
03/12/2015 PHP 7.0 - Zend Engine 3.0
20XX - PHP 8.0 - Zend Engine X.X? - JIT Compiler?
RECENTLY
Yo, what’s fresh?
83.1% Websites (W3C) and growing
PHP will survive.
PHP 7.3.0 scope ✓
PHP 7.4.0 started
PHP next version discussed
7.3.0
On the one and two and three.
Non-RFC stuff.
It’s also a project.
Dead code removal (internals)
function foo(int $x, int $y) {
$a = [$x];
$a[1] = $y;
$a = $y;
return $a;
}
PHP 7.2 PHP 7.3
foo: (lines=7, args=2, vars=3, tmps=1) foo: (lines=4, args=2, vars=3,
tmps=0)
L0: CV0($x) = RECV 1 L0: CV0($x) = RECV 1
L1: CV1($y) = RECV 2 L1: CV1($y) = RECV 2
L2: CV2($a) = INIT_ARRAY 1 CV0($x) NEXT L2: CV2($a) = QM_ASSIGN
CV1($y)
L3: ASSIGN_DIM CV2($a) int(1) L3: RETURN CV2($a)
L4: OP_DATA CV1($y)
L5: ASSIGN CV2($a) CV1($y)
L6: RETURN CV2($a)
class A { }
function foo(int $x)
{
$a = new A;
$a->foo = $x;
return $x;
}
PHP 7.3
foo: (lines=2, args=1, vars=1, tmps=0)
L0: CV0($x) = RECV 1
L1: RETURN CV0($x)
Dead code removal (internals)
function foo() {
$o = new stdClass();
$o->foo = 0;
$i = 1;
$c = $i < 2;
if ($c) {
$k = 2 * $i;
$o->foo = $i;
echo $o->foo;
}
$o->foo += 2;
$o->foo++;
return $o->foo;
}
PHP 7.3
foo: (lines=2, args=0, vars=0, tmps=0)
L0: ECHO int(1)
L1: RETURN int(4)
Indenting HEREDOC/NOWDOC
$replacement = ‘vraiment’;
// PHP 5.3+, LIMITE peut être entouré de “ ”
$heredocVar = [‘truc’, <<<LIMITE
Tiens, et si on mettait du
Lorem Ipsum, juste histoire
de se marrer un peu, parce
que $replacement c’est un truc
qu’on n’a jamais vu.
LIMITE, ‘autre truc’];
$replacement = ‘vraiment’;
// PHP 5.3+, LIMITE peut être entouré de “ ”
$heredocVar = [‘truc’, <<<LIMITE
Tiens, et si on mettait du
Lorem Ipsum, juste histoire
de se marrer un peu, parce
que $replacement c’est un truc
qu’on n’a jamais vu.
LIMITE, ‘autre truc’];
/*
Array (
[0] => “truc”,
[1] => “Tiens, et si on mettait du Lorem Ipsum, juste histoire de se marrer un peu, parce
que vraiment c’est un truc qu’on n’a jamais vu.”,
[2] => “autre truc”
)
*/
PHP 7.3 +< PHP 7.3
array_key_first()
array_key_last()
Trailing commas (,) in function calls
function foo(int $x, int $y) {
//...
}
echo foo($a, $b,);
JSON parsing error thrown
JSON_THROW_ON_ERROR
PCRE2 migration - with JIT engine
list() reference assignment
$tab = [‘Hello’, ‘AFUP’];
list($a, &$b) = $tab;
$b = ‘Limoges’;
var_dump($tab[1]); string(7) "Limoges"
is_countable()
compact() fixed
Case insensitive constants deprecation
define(‘AFUP’, ‘Limoges’, true);
// Deprecated: define(): Declaration of case-insensitive constants is deprecated
Same site cookies on the way.
7.4.0
Deeper down the rabbit hole.
Strong typing in class variables /
typed properties
class Example {
public int $scalarType;
protected ClassName $classType;
private ?ClassName $nullableClassType;
public static iterable $staticProp;
var bool $flag;
public string $str = "foo";
public ?string $nullableStr = null;
public float $x, $y;
// public float $x;
// public float $y;
}
Real-life benchmarks (master vs patch)
======================================
Master typed diff
blog 169 168 -0.77%
fw 818 809 -1.10%
qdig 716 716 +0.04%
scrum 517 502 -2.84%
ZF1 Hello 2,637 2,605 -1.23%
ZF2 Test 675 667 -1.13%
wordpress-3.6 373 368 -1.47%
drupal-7.27 560 539 -3.77%
SugarCRM 470 453 -3.68%
magento-home 90 90 +0.45%
magento-cat 30 30 -0.67%
drupal-8.0.0 860 867 +0.81%
mediawiki 114 107 -6.39%
wordpress-4.1 346 344 -0.69%
symfony_demo 661 660 -0.24%
Synthetic benchmarks (master vs patch vs patch + type hints)
===========================================================
Master typed typed+hints
empty_loop 0.026 0.026 0.026
$x = self::$x 0.090 0.118 0.117
self::$x = $n 0.086 0.094 0.108
isset(self::$x) 0.075 0.091 0.092
empty(self::$x) 0.072 0.095 0.095
$x = Foo::$x 0.069 0.081 0.079
Foo::$x = $n 0.068 0.054 0.071
isset(Foo::$x) 0.053 0.051 0.051
$x = $this->x 0.128 0.126 0.105
$this->x = $n 0.057 0.059 0.065
$this->x += 2 0.096 0.098 0.120
++$this->x 0.074 0.081 0.082
--$this->x 0.075 0.082 0.082
$this->x++ 0.075 0.083 0.082
$this->x-- 0.074 0.082 0.084
isset($this->x) 0.078 0.076 0.076
empty($this->x) 0.083 0.083 0.082
$ref = $n 0.056 0.054 0.093
Performance
Impacts?
Hash functions loaded by default
7.5.0
Why and why not.
WANT SOME MORE?
8.0.0
Enter the infinite.
AoT >> JIT?
Compilation masterminds.
FFI
Breaking the walls.
<?php
$libc = new FFI("
int printf(const char *format, ...);
const char * getenv(const char *);
unsigned int time(unsigned int *);
typedef unsigned int time_t;
typedef unsigned int suseconds_t;
struct timeval {
time_t tv_sec;
suseconds_t tv_usec;
};
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
int gettimeofday(struct timeval *tv, struct timezone *tz);
", "libc.so.6");
$libc->printf("Hello AFUP from %s!n", "Limoges");
var_dump($libc->getenv("PATH"));
var_dump($libc->time(null));
$tv = $libc->new("struct timeval");
$tz = $libc->new("struct timezone");
$libc->gettimeofday(FFI::addr($tv), FFI::addr($tz));
var_dump($tv->tv_sec, $tv->tv_usec, $tz);
?>
Hello AFUP from Limoges!
string(135) "/usr/lib64/qt-
3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/
bin:/bin:/usr/loc"
int(1523617815)
int(1523617815)
int(977765)
object(FFICData:<struct>)#3 (2) {
["tz_minuteswest"]=>
int(-180)
["tz_dsttime"]=>
int(0)
}
<?php
$p = FFI::new("int[2]");
$p[0] = 1;
$p[1] = 2;
foreach ($p as $key => $val) {
echo "$key => $valn";
}
// “0 => 1n”
// “1 => 2n”
$pp = FFI::new("struct {int x,y;}[2]");
foreach($pp as $n => &$p) {
$p->x = $p->y = $n;
}
var_dump($pp);
object(FFICData:<struct>[2])#1 (2) {
[0]=>
object(FFICData:<struct>)#2 (2) {
["x"]=>
int(0)
["y"]=>
int(0)
}
[1]=>
object(FFICData:<struct>)#3 (2) {
["x"]=>
int(1)
["y"]=>
int(1)
}
}
?>
OpCache core
I’ve already seen that cat.
PreLoading
Did you see that coming?
Asynchronism
Legen… Wait for it. Dary. Legendary.
Merging symbols tables
Already defined, mate.
Extend instanceof
You’re my type.
Negative Index
array_keys(array_fill(-2, 4, true)); // [-2, 0, 1, 2]; - PHP 7.2.9
array_keys(array_fill(-2, 4, true)); // [-2, -1, 0, 1]; - PHP 8.0.0
Null coalesce equals?
$a = null;
$b = “test”;
$a ??= ‘yep’; // $a === ‘yep’
$b ??= ‘yep’; // $b === ‘test’
Case insensitive
constants removed
UNLESS you CARE about THAT, It’S QuIte CoOL.
Many other deletions.
Consistency fixes.
“But for those of us who’d lived and died in them furious days,
it was like everything we knew was mightily swept away.”
THANK YOU ❤
WILLIAM PINAUD
NINJA PROJECT MANAGER & ARCHITECT
SLIDES ♥ AFUP LIMOGES

Weitere ähnliche Inhalte

Was ist angesagt?

What's New in PHP 5.5
What's New in PHP 5.5What's New in PHP 5.5
What's New in PHP 5.5Corey Ballou
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The AnswerIan Barber
 
Swiftの関数型っぽい部分
Swiftの関数型っぽい部分Swiftの関数型っぽい部分
Swiftの関数型っぽい部分bob_is_strange
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleIan Barber
 
Lexical environment in ecma 262 5
Lexical environment in ecma 262 5Lexical environment in ecma 262 5
Lexical environment in ecma 262 5Kim Hunmin
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervosoLuis Vendrame
 
Créer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heureCréer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heureAmaury Bouchard
 
... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)James Titcumb
 
Jakub Kulhán - ReactPHP + Symfony = PROFIT (1. sraz přátel Symfony v Praze)
Jakub Kulhán - ReactPHP + Symfony = PROFIT (1. sraz přátel Symfony v Praze)Jakub Kulhán - ReactPHP + Symfony = PROFIT (1. sraz přátel Symfony v Praze)
Jakub Kulhán - ReactPHP + Symfony = PROFIT (1. sraz přátel Symfony v Praze)Péhápkaři
 
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)James Titcumb
 
The Magic Of Tie
The Magic Of TieThe Magic Of Tie
The Magic Of Tiebrian d foy
 
Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongersbrian d foy
 
C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)Yuki Tamura
 
Melhorando sua API com DSLs
Melhorando sua API com DSLsMelhorando sua API com DSLs
Melhorando sua API com DSLsAugusto Pascutti
 
Hacking Parse.y with ujihisa
Hacking Parse.y with ujihisaHacking Parse.y with ujihisa
Hacking Parse.y with ujihisaujihisa
 

Was ist angesagt? (20)

What's New in PHP 5.5
What's New in PHP 5.5What's New in PHP 5.5
What's New in PHP 5.5
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The Answer
 
Swiftの関数型っぽい部分
Swiftの関数型っぽい部分Swiftの関数型っぽい部分
Swiftの関数型っぽい部分
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
 
Lexical environment in ecma 262 5
Lexical environment in ecma 262 5Lexical environment in ecma 262 5
Lexical environment in ecma 262 5
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervoso
 
Créer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heureCréer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heure
 
C++ tutorial
C++ tutorialC++ tutorial
C++ tutorial
 
Sbaw091006
Sbaw091006Sbaw091006
Sbaw091006
 
... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)
 
Jakub Kulhán - ReactPHP + Symfony = PROFIT (1. sraz přátel Symfony v Praze)
Jakub Kulhán - ReactPHP + Symfony = PROFIT (1. sraz přátel Symfony v Praze)Jakub Kulhán - ReactPHP + Symfony = PROFIT (1. sraz přátel Symfony v Praze)
Jakub Kulhán - ReactPHP + Symfony = PROFIT (1. sraz přátel Symfony v Praze)
 
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
 
The Magic Of Tie
The Magic Of TieThe Magic Of Tie
The Magic Of Tie
 
Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongers
 
C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)C++の話(本当にあった怖い話)
C++の話(本当にあった怖い話)
 
Perl 6 by example
Perl 6 by examplePerl 6 by example
Perl 6 by example
 
Javascript: The Important Bits
Javascript: The Important BitsJavascript: The Important Bits
Javascript: The Important Bits
 
Melhorando sua API com DSLs
Melhorando sua API com DSLsMelhorando sua API com DSLs
Melhorando sua API com DSLs
 
Php 5.6
Php 5.6Php 5.6
Php 5.6
 
Hacking Parse.y with ujihisa
Hacking Parse.y with ujihisaHacking Parse.y with ujihisa
Hacking Parse.y with ujihisa
 

Ähnlich wie PHP in 2018 - Q4 - AFUP Limoges

Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & ToolsIan Barber
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionIan Barber
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest UpdatesIftekhar Eather
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy CodeRowan Merewood
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Masahiro Nagano
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesPHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesEric Poe
 
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Nikita Popov
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkChristian Trabold
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.Binny V A
 
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?Radek Benkel
 
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
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Joseph Scott
 
Giới thiệu PHP 7
Giới thiệu PHP 7Giới thiệu PHP 7
Giới thiệu PHP 7ZendVN
 

Ähnlich wie PHP in 2018 - Q4 - AFUP Limoges (20)

Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & Tools
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
 
PHP 5.4
PHP 5.4PHP 5.4
PHP 5.4
 
Introducing PHP Latest Updates
Introducing PHP Latest UpdatesIntroducing PHP Latest Updates
Introducing PHP Latest Updates
 
Having Fun Programming!
Having Fun Programming!Having Fun Programming!
Having Fun Programming!
 
Php 7 evolution
Php 7 evolutionPhp 7 evolution
Php 7 evolution
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7
 
PHP7 Presentation
PHP7 PresentationPHP7 Presentation
PHP7 Presentation
 
What's new with PHP7
What's new with PHP7What's new with PHP7
What's new with PHP7
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesPHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return Types
 
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?
 
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
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
 
Giới thiệu PHP 7
Giới thiệu PHP 7Giới thiệu PHP 7
Giới thiệu PHP 7
 

Kürzlich hochgeladen

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 

Kürzlich hochgeladen (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

PHP in 2018 - Q4 - AFUP Limoges

  • 1.
  • 2. $SLIDES_SOURCES = { ‘RASMUS LERDORF’, ‘ZEEV ZURASKI’, ‘JOHN MORRIS’, }; TOPIC
  • 3. WILLIAM PINAUD NINJA PROJECT MANAGER & ARCHITECT SLIDES ♥ AFUP LIMOGES PHP // NEW STUFF AND BEYOND Q4 2018
  • 4. 08/06/1995 Personal Home Page 1.0 / Forms Interpreter on Usenet 01/11/1997 PHP/FI 2.0 06/06/1998 Ze + nd - PHP: Hypertext Preprocessor - PHP 3.0 - Zend Engine 1.0 22/05/2000 PHP 4.0 14/07/2004 PHP 5.0 - Zend Engine 2.0 2005 > 2010 PHP 6.0 - ICU-based engine (RIP) 03/12/2015 PHP 7.0 - Zend Engine 3.0 20XX - PHP 8.0 - Zend Engine X.X? - JIT Compiler?
  • 6. 83.1% Websites (W3C) and growing
  • 8. PHP 7.3.0 scope ✓ PHP 7.4.0 started PHP next version discussed
  • 9. 7.3.0 On the one and two and three.
  • 11. Dead code removal (internals) function foo(int $x, int $y) { $a = [$x]; $a[1] = $y; $a = $y; return $a; } PHP 7.2 PHP 7.3 foo: (lines=7, args=2, vars=3, tmps=1) foo: (lines=4, args=2, vars=3, tmps=0) L0: CV0($x) = RECV 1 L0: CV0($x) = RECV 1 L1: CV1($y) = RECV 2 L1: CV1($y) = RECV 2 L2: CV2($a) = INIT_ARRAY 1 CV0($x) NEXT L2: CV2($a) = QM_ASSIGN CV1($y) L3: ASSIGN_DIM CV2($a) int(1) L3: RETURN CV2($a) L4: OP_DATA CV1($y) L5: ASSIGN CV2($a) CV1($y) L6: RETURN CV2($a) class A { } function foo(int $x) { $a = new A; $a->foo = $x; return $x; } PHP 7.3 foo: (lines=2, args=1, vars=1, tmps=0) L0: CV0($x) = RECV 1 L1: RETURN CV0($x)
  • 12. Dead code removal (internals) function foo() { $o = new stdClass(); $o->foo = 0; $i = 1; $c = $i < 2; if ($c) { $k = 2 * $i; $o->foo = $i; echo $o->foo; } $o->foo += 2; $o->foo++; return $o->foo; } PHP 7.3 foo: (lines=2, args=0, vars=0, tmps=0) L0: ECHO int(1) L1: RETURN int(4)
  • 14. $replacement = ‘vraiment’; // PHP 5.3+, LIMITE peut être entouré de “ ” $heredocVar = [‘truc’, <<<LIMITE Tiens, et si on mettait du Lorem Ipsum, juste histoire de se marrer un peu, parce que $replacement c’est un truc qu’on n’a jamais vu. LIMITE, ‘autre truc’]; $replacement = ‘vraiment’; // PHP 5.3+, LIMITE peut être entouré de “ ” $heredocVar = [‘truc’, <<<LIMITE Tiens, et si on mettait du Lorem Ipsum, juste histoire de se marrer un peu, parce que $replacement c’est un truc qu’on n’a jamais vu. LIMITE, ‘autre truc’]; /* Array ( [0] => “truc”, [1] => “Tiens, et si on mettait du Lorem Ipsum, juste histoire de se marrer un peu, parce que vraiment c’est un truc qu’on n’a jamais vu.”, [2] => “autre truc” ) */ PHP 7.3 +< PHP 7.3
  • 16. Trailing commas (,) in function calls function foo(int $x, int $y) { //... } echo foo($a, $b,);
  • 17. JSON parsing error thrown JSON_THROW_ON_ERROR
  • 18. PCRE2 migration - with JIT engine
  • 20. $tab = [‘Hello’, ‘AFUP’]; list($a, &$b) = $tab; $b = ‘Limoges’; var_dump($tab[1]); string(7) "Limoges"
  • 23. Case insensitive constants deprecation define(‘AFUP’, ‘Limoges’, true); // Deprecated: define(): Declaration of case-insensitive constants is deprecated
  • 24. Same site cookies on the way.
  • 25. 7.4.0 Deeper down the rabbit hole.
  • 26. Strong typing in class variables / typed properties
  • 27. class Example { public int $scalarType; protected ClassName $classType; private ?ClassName $nullableClassType; public static iterable $staticProp; var bool $flag; public string $str = "foo"; public ?string $nullableStr = null; public float $x, $y; // public float $x; // public float $y; }
  • 28. Real-life benchmarks (master vs patch) ====================================== Master typed diff blog 169 168 -0.77% fw 818 809 -1.10% qdig 716 716 +0.04% scrum 517 502 -2.84% ZF1 Hello 2,637 2,605 -1.23% ZF2 Test 675 667 -1.13% wordpress-3.6 373 368 -1.47% drupal-7.27 560 539 -3.77% SugarCRM 470 453 -3.68% magento-home 90 90 +0.45% magento-cat 30 30 -0.67% drupal-8.0.0 860 867 +0.81% mediawiki 114 107 -6.39% wordpress-4.1 346 344 -0.69% symfony_demo 661 660 -0.24% Synthetic benchmarks (master vs patch vs patch + type hints) =========================================================== Master typed typed+hints empty_loop 0.026 0.026 0.026 $x = self::$x 0.090 0.118 0.117 self::$x = $n 0.086 0.094 0.108 isset(self::$x) 0.075 0.091 0.092 empty(self::$x) 0.072 0.095 0.095 $x = Foo::$x 0.069 0.081 0.079 Foo::$x = $n 0.068 0.054 0.071 isset(Foo::$x) 0.053 0.051 0.051 $x = $this->x 0.128 0.126 0.105 $this->x = $n 0.057 0.059 0.065 $this->x += 2 0.096 0.098 0.120 ++$this->x 0.074 0.081 0.082 --$this->x 0.075 0.082 0.082 $this->x++ 0.075 0.083 0.082 $this->x-- 0.074 0.082 0.084 isset($this->x) 0.078 0.076 0.076 empty($this->x) 0.083 0.083 0.082 $ref = $n 0.056 0.054 0.093 Performance Impacts?
  • 29. Hash functions loaded by default
  • 33. AoT >> JIT? Compilation masterminds.
  • 34.
  • 36. <?php $libc = new FFI(" int printf(const char *format, ...); const char * getenv(const char *); unsigned int time(unsigned int *); typedef unsigned int time_t; typedef unsigned int suseconds_t; struct timeval { time_t tv_sec; suseconds_t tv_usec; }; struct timezone { int tz_minuteswest; int tz_dsttime; }; int gettimeofday(struct timeval *tv, struct timezone *tz); ", "libc.so.6"); $libc->printf("Hello AFUP from %s!n", "Limoges"); var_dump($libc->getenv("PATH")); var_dump($libc->time(null)); $tv = $libc->new("struct timeval"); $tz = $libc->new("struct timezone"); $libc->gettimeofday(FFI::addr($tv), FFI::addr($tz)); var_dump($tv->tv_sec, $tv->tv_usec, $tz); ?> Hello AFUP from Limoges! string(135) "/usr/lib64/qt- 3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/ bin:/bin:/usr/loc" int(1523617815) int(1523617815) int(977765) object(FFICData:<struct>)#3 (2) { ["tz_minuteswest"]=> int(-180) ["tz_dsttime"]=> int(0) }
  • 37. <?php $p = FFI::new("int[2]"); $p[0] = 1; $p[1] = 2; foreach ($p as $key => $val) { echo "$key => $valn"; } // “0 => 1n” // “1 => 2n” $pp = FFI::new("struct {int x,y;}[2]"); foreach($pp as $n => &$p) { $p->x = $p->y = $n; } var_dump($pp); object(FFICData:<struct>[2])#1 (2) { [0]=> object(FFICData:<struct>)#2 (2) { ["x"]=> int(0) ["y"]=> int(0) } [1]=> object(FFICData:<struct>)#3 (2) { ["x"]=> int(1) ["y"]=> int(1) } } ?>
  • 38. OpCache core I’ve already seen that cat.
  • 39. PreLoading Did you see that coming?
  • 40. Asynchronism Legen… Wait for it. Dary. Legendary.
  • 43. Negative Index array_keys(array_fill(-2, 4, true)); // [-2, 0, 1, 2]; - PHP 7.2.9 array_keys(array_fill(-2, 4, true)); // [-2, -1, 0, 1]; - PHP 8.0.0
  • 44. Null coalesce equals? $a = null; $b = “test”; $a ??= ‘yep’; // $a === ‘yep’ $b ??= ‘yep’; // $b === ‘test’
  • 45. Case insensitive constants removed UNLESS you CARE about THAT, It’S QuIte CoOL.
  • 46. Many other deletions. Consistency fixes. “But for those of us who’d lived and died in them furious days, it was like everything we knew was mightily swept away.”
  • 47. THANK YOU ❤ WILLIAM PINAUD NINJA PROJECT MANAGER & ARCHITECT SLIDES ♥ AFUP LIMOGES