PHP and Xdebug talks for PHP Brussels

This commit is contained in:
Derick Rethans
2019-12-11 10:34:30 +00:00
parent c728b39f85
commit bcbe5b0fad
23 changed files with 212 additions and 81 deletions

69
php-brussels19.xml Normal file
View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<presentation css="derick.css">
<topic>Debugging</topic>
<title>The La(te)st PHP 7 — What's&#160;new&#160;in&#160;PHP&#160;7.4</title>
<event>Brussels PHP UG</event>
<location>Brussels, Belgium</location>
<date>December 11th, 2019</date>
<speaker>Derick Rethans</speaker>
<email>derick@php.net</email>
<twitter>derickr</twitter>
<url>https://derickrethans.nl/talks/php-brussels19</url>
<joindin></joindin>
<slide>slides/xdebug/title.xml</slide>
<slide>slides/mongodb/me.xml</slide>
<slide>slides/internals/php74-typed-properties.xml</slide>
<slide>slides/internals/php74-typed-properties-read.xml</slide>
<slide>slides/internals/php74-typed-properties-write.xml</slide>
<slide>slides/internals/php74-typed-properties-write-coersive.xml</slide>
<slide>slides/internals/php74-typed-properties-write-strict.xml</slide>
<slide>slides/internals/php74-variance-return-ok.xml</slide>
<slide>slides/internals/php74-variance-return-wrong.xml</slide>
<slide>slides/internals/php74-variance-argument-ok.xml</slide>
<slide>slides/internals/php74-variance-argument-wrong.xml</slide>
<slide>slides/internals/php74-variance-properties-ok.xml</slide>
<slide>slides/internals/php74-variance-properties-wrong.xml</slide>
<slide>slides/internals/php74-null-coalesce-assignment.xml</slide>
<slide>slides/internals/php74-spread-operator.xml</slide>
<slide>slides/internals/php74-invalid-container-read.xml</slide>
<slide>slides/internals/php74-ffi.xml</slide>
<slide>slides/internals/php74-ffi-example.xml</slide>
<slide>slides/internals/php74-preloading.xml</slide>
<slide>slides/internals/php74-preloading-setup.xml</slide>
<slide>slides/internals/php74-preloading-zf.xml</slide>
<slide>slides/internals/php74-preloading-with-ffi.xml</slide>
<slide>slides/internals/php74-reference-reflection.xml</slide>
<slide>slides/internals/php74-custom-serialization.xml</slide>
<slide>slides/internals/php74-custom-serialization-inheritence.xml</slide>
<slide>slides/internals/php74-always-hash.xml</slide>
<slide>slides/internals/php74-unbundle.xml</slide>
<slide>slides/xdebug/phpinternalsnews.xml</slide>
<slide>slides/internals/phpinternalsnews-me.xml</slide>
<slide>slides/internals/php74-saner-string-number-comparisons.xml</slide>
<slide>slides/internals/php74-weakref.xml</slide>
<slide>slides/internals/php74-short-arrow-functions.xml</slide>
<slide>slides/internals/php74-short-arrow-functions-example.xml</slide>
<slide>slides/internals/php74-lsp-operator-precedence-lsp.xml</slide>
<slide>slides/internals/php74-operator-precedence-ternary.xml</slide>
<slide>slides/internals/php74-concat-operator-precedence.xml</slide>
<slide>slides/internals/php74-hash-argon.xml</slide>
<slide>slides/internals/php74-__tostring-exceptions.xml</slide>
<slide>slides/internals/php74-base-convert.xml</slide>
<slide>slides/internals/php74-numeric-literal-separator.xml</slide>
<slide>slides/internals/php74-deprecate-curly-brace.xml</slide>
<slide>slides/internals/php74-postgresql-escape.xml</slide>
<!-- <slide>slides/internals/php74-arginfo.xml</slide> -->
<slide>slides/internals/php74-deprecations.xml</slide>
<slide>slides/internals/php74-timeline.xml</slide>
<slide>slides/internals/questions-new.xml</slide>
<slide>slides/xdebug/resources.xml</slide>
</presentation>

View File

@@ -7,7 +7,7 @@ Episode 14 — __toString Exceptions — Nikita Popov
<example result="1">
&lt;?php
class 💥
class 💥explode
{
function __toString()
{
@@ -15,8 +15,8 @@ class 💥
}
}
$💣 = new 💥;
echo $💣;
$💣bomb = new 💥explode;
echo $💣bomb;
?>
</example>
<break lines="3"/>
@@ -24,7 +24,7 @@ echo $💣;
<div effect="fade-out">
<blurb>PHP 7.3:</blurb>
<example class="error">
Fatal error: Method 💥::__toString() must not throw an exception, caught Exception
Fatal error: Method 💥explode::__toString() must not throw an exception, caught Exception
</example>
</div>

View File

@@ -22,8 +22,8 @@ echo "sum: " . $a + $b;
<break/>
<blurb>In PHP 7.4:</blurb>
<example class="error">
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-'
will change in PHP 8: '+'/'-' will take a higher precedence in Standard input code on line 3
The behavior of unparenthesized expressions containing both '.' and '+'/'-'
will change in PHP 8: '+'/'-' will take a higher precedence in example.php on line 3
</example>
<break/>

View File

@@ -3,28 +3,26 @@
<example result="1">
&lt;?php
class 🔥 {
class 🔥fire {
private $temperature = 5000;
public function __serialize(): array { return ['t' => $this->temperature]; }
public function __unserialize(array $data) { $this->temperature = $data['t']; }
}
class ⭐ extends 🔥 {
class ⭐star extends 🔥fire {
private $size = 695510000;
public function __serialize(): array {
return [
's' => $this->size,
'🔥' => parent::__serialize(),
'🔥fire' => parent::__serialize(),
];
}
public function __unserialize(array $data) {
parent::__unserialize( $data['🔥'] );
parent::__unserialize( $data['🔥fire'] );
$this->size = $data['s'];
}
}
echo serialize( $test = new ⭐ );
echo serialize( $test = new ⭐star );
</example>
</slide>

View File

@@ -9,13 +9,13 @@ https://wiki.php.net/rfc/deprecate_curly_braces_array_access — https://github.
<example result="1">
&lt;?php
$🌻 = [ 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 ];
echo $🌻[4], "\n";
echo $🌻{4}, "\n";
$🌻fibon = [ 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 ];
echo $🌻fibon[4], "\n";
echo $🌻fibon{4}, "\n";
$🎄 = "Christmas Tree";
echo $🎄[4], "\n";
echo $🎄{4}, "\n";
$🎄spruce = "Christmas Tree";
echo $🎄spruce[4], "\n";
echo $🎄spruce{4}, "\n";
?>
</example>

View File

@@ -37,8 +37,8 @@ print_r(password_algos());
<div effect="fade-in">
<example>
password_hash(string $password, int $algo, array $options) : string
password_verify(string $password, string $hash) : bool
password_hash(string $pw, int $algo, array $options) : string
password_verify(string $pw, string $hash) : bool
</example>
<blurb>Options:</blurb>
<list>

View File

@@ -21,16 +21,16 @@ $b = ($a[0][0] + $c[0]);
<div effect="fade-in">
<example class="error">
Notice: Trying to access array offset on value of type bool in /tmp/example.php on line 6
Notice: Trying to access array offset on value of type null in /tmp/example.php on line 6
Notice: Trying to access array offset on value of type null in /tmp/example.php on line 6
Notice: Trying to access array offset on value of type null in /tmp/example.php on line 6
Notice: Trying to access array offset on value of type null in /tmp/example.php on line 6
Notice: Trying to access array offset on value of type bool in example.php on line 6
Notice: Trying to access array offset on value of type null in example.php on line 6
Notice: Trying to access array offset on value of type null in example.php on line 6
Notice: Trying to access array offset on value of type null in example.php on line 6
Notice: Trying to access array offset on value of type null in example.php on line 6
Notice: Trying to access array offset on value of type int in /tmp/example.php on line 9
Notice: Trying to access array offset on value of type int in example.php on line 9
Notice: Trying to access array offset on value of type null in /tmp/example.php on line 13
Notice: Trying to access array offset on value of type null in /tmp/example.php on line 13
Notice: Trying to access array offset on value of type null in example.php on line 13
Notice: Trying to access array offset on value of type null in example.php on line 13
</example>
</div>

View File

@@ -9,7 +9,7 @@ http://wiki.php.net/rfc/concatenation_precedence — Deprecate only: https://git
<example result="1">
&lt;?php
$a = 3;
echo $a == 1 ? 'one' : $a == 2 ? 'two' : $a == 3 ? 'three' : $a == 4 ? 'four' : 'other', "\n";
echo $a == 1 ? 'one' : $a == 2 ? 'two' : $a == 3 ? 'three' : $a == 4 ? 'four' : 'other';
?>
</example>
@@ -17,11 +17,14 @@ echo $a == 1 ? 'one' : $a == 2 ? 'two' : $a == 3 ? 'three' : $a == 4 ? 'four' :
<break/>
<blurb>In PHP 7.4:</blurb>
<example class="error">
Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in Standard input code on line 3
Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated.
Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in example.php on line 3
Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in Standard input code on line 3
Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated.
Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in example.php on line 3
Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in Standard input code on line 3
Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated.
Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in example.php on line 3
</example>
</div>

View File

@@ -3,9 +3,6 @@
<break lines="5"/>
<div effect="fade-in">
<blurb class="big-centre">November 28th</blurb>
</div>
<div effect="fade-in">
<blurb class="centre">(possibly) 😉 </blurb>
<blurb class="big-centre">It already is!<br/><small>(November 28th)</small></blurb>
</div>
</slide>

View File

@@ -3,14 +3,14 @@
<example>
&lt;?php
class 🥃
class 🥃whisky
{
public int $age;
protected Distillery $distillery;
private ?Bottler $bottler;
}
$whisky = new 🥃;
$whisky = new 🥃whisky;
echo $whisky->age;
?>
@@ -18,7 +18,7 @@ echo $whisky->age;
<break/>
<div effect="fade-in">
<blurb class="error">
Error: Typed property 🥃::$age must not be accessed before initialization
Error: Typed property 🥃whisky::$age must not be accessed before initialization
</blurb>
<break lines="2"/>

View File

@@ -3,14 +3,14 @@
<example result="1">
&lt;?php
class 🥃
class 🥃whisky
{
public int $age;
protected Distillery $distillery;
private ?Bottler $bottler;
}
$whisky = new 🥃;
$whisky = new 🥃whisky;
$whisky->age = "29";
var_dump($whisky);

View File

@@ -5,14 +5,14 @@
&lt;?php
declare(strict_types=1);
class 🥃
class 🥃whisky
{
public int $age;
public Distillery $distillery;
private ?Bottler $bottler;
}
$whisky = new 🥃;
$whisky = new 🥃whisky;
$whisky->age = 29;
?>
</example>
@@ -20,7 +20,7 @@ $whisky->age = 29;
<div effect="fade-in">
<blurb class="error">
TypeError: Typed property 🥃::$age must be int, string used
TypeError: Typed property 🥃whisky::$age must be int, string used
</blurb>
</div>
</slide>

View File

@@ -3,14 +3,14 @@
<example result="0">
&lt;?php
class 🥃
class 🥃whisky
{
public int $age;
public Distillery $distillery;
private ?Bottler $bottler;
}
$whisky = new 🥃;
$whisky = new 🥃whisky;
$whisky->distillery = "Lagavullin";
?>
</example>
@@ -18,7 +18,7 @@ $whisky->distillery = "Lagavullin";
<div effect="fade-in">
<blurb class="error">
TypeError: Typed property 🥃::$distillery must be an instance of Distillery, string used
TypeError: Typed property 🥃whisky::$distillery must be an instance of Distillery, string used
</blurb>
<break lines="2"/>

View File

@@ -5,7 +5,7 @@ https://wiki.php.net/rfc/typed_properties_v2 — https://wiki.php.net/rfc/typed_
<example>
&lt;?php
class 🥃
class 🥃whisky
{
</example>
<div effect="fade-in">

View File

@@ -3,17 +3,17 @@
<example result="1">
&lt;?php
class 🐖 {}
class 🐗 extends 🐖 {}
class 🐖pig {}
class 🐗boar extends 🐖pig {}
class Asterix
{
public function hunt(🐗 $animal) {}
public function hunt(🐗boar $animal) {}
}
class Gauls extends Asterix
{
public function hunt(🐖 $animal) {}
public function hunt(🐖pig $animal) {}
}
?>
</example>

View File

@@ -3,22 +3,22 @@
<example result="0">
&lt;?php
class 🐖 {}
class 🐗 extends 🐖 {}
class 🐖pig {}
class 🐗boar extends 🐖 {}
class Asterix
{
public function hunt(🐖 $animal) {}
public function hunt(🐖pig $animal) {}
}
class Gauls extends Asterix
{
public function hunt(🐗 $animal) {}
public function hunt(🐗boar $animal) {}
}
?>
</example>
<blurb class="error">Warning: Declaration of Gauls::hunt(🐗 $animal) should be compatible with Asterix::hunt(🐖 $animal)</blurb>
<blurb class="error">Warning: Declaration of Gauls::hunt(🐗boar $animal) should be compatible with Asterix::hunt(🐖pig $animal)</blurb>
<break lines="2"/>
<blurb class="center">Arguments types are *contra-variant*:<br/>~they can *not* accept a more specific type~</blurb>
</slide>

View File

@@ -8,17 +8,17 @@ typed properties are invariant
<example>
&lt;?php
class 🌐 {}
class 🌏 extends 🌐 {}
class 🌐sphere {}
class 🌏planet extends 🌐sphere {}
class Bakery
{
public 🌏 $gravity;
public 🌏planet $gravity;
}
class Patisserie extends Bakery
{
public 🌏 $gravity;
public 🌏planet $gravity;
}
?>
</example>

View File

@@ -8,22 +8,22 @@ typed properties are invariant
<example return="1">
&lt;?php
class 🌐 {}
class 🌏 extends 🌐 {}
class 🌐sphere {}
class 🌏planet extends 🌐sphere {}
class Bakery
{
public 🌐 $temperature;
public 🌐sphere $temperature;
}
class Patisserie extends Bakery
{
public 🌏 $temperature;
public 🌏planet $temperature;
}
?>
</example>
<blurb class="error">Fatal error: Type of Patisserie::$temperature must be 🌐 (as in class Bakery)</blurb>
<blurb class="error">Fatal error: Type of Patisserie::$temperature must be 🌐sphere (as in class Bakery)</blurb>
<break lines="2"/>
<blurb class="center">Property types are *in-variant*:<br/>~they can *not* represent a more specific or a more broad type~</blurb>
</slide>

View File

@@ -8,17 +8,17 @@ typed properties are invariant
<example result="1">
&lt;?php
class 🍞 {}
class 🥖 extends 🍞 {}
class 🍞bread {}
class 🥖baguette extends 🍞bread {}
class Bakery
{
public function gimme(): 🍞 {}
public function gimme(): 🍞bread {}
}
class Patisserie extends Bakery
{
public function gimme(): 🥖 {}
public function gimme(): 🥖baguette {}
}
?>
</example>

View File

@@ -8,22 +8,22 @@ typed properties are invariant
<example>
&lt;?php
class 🍞 {}
class 🥖 extends 🍞 {}
class 🍞bread {}
class 🥖baguette extends 🍞bread {}
class Bakery
{
public function gimme(): 🥖 {}
public function gimme(): 🥖baguette {}
}
class Patisserie extends Bakery
{
public function gimme(): 🍞 {}
public function gimme(): 🍞bread {}
}
?>
</example>
<blurb class="error">Fatal error: Declaration of Patisserie::gimme(): 🍞 must be compatible with Bakery::gimme(): 🥖</blurb>
<blurb class="error">Fatal error: Declaration of Patisserie::gimme(): 🍞bread must be compatible with Bakery::gimme(): 🥖baguette</blurb>
<break lines="2"/>
<blurb class="center">Return types are *co-variant*:<br/>~they can *not* return a more broad type~</blurb>
</slide>

View File

@@ -16,8 +16,9 @@ final class WeakReference {
<blurb>Example:</blurb>
<example result="1">
&lt;?php
class 👻 { function boo() { echo "BOO!\n"; } }
$boo = new 👻 ;
class 👻ghost { function boo() { echo "BOO!\n"; } }
$boo = new 👻ghost;
$ref = WeakReference::create( $boo );
$ref->get()->boo();

View File

@@ -18,9 +18,6 @@
|aaaaaa| 12|
|aaaaaa| 13| demo(true, true, true, false);
]]></example>
<div effect="fade-in-out">
<blurb class="big-centre">demo</blurb>
</div>
</td>
<td><div effect="fade-in">
<example inline="2"><![CDATA[

66
xdebug-brussels19.xml Normal file
View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<presentation css="derick.css">
<topic>Debugging</topic>
<title>Xdebug 3.0</title>
<event>Brussels PHP UG</event>
<location>Brussels, Belgium</location>
<date>December 11th, 2019</date>
<speaker>Derick Rethans</speaker>
<email>derick@xdebug.org</email>
<twitter>derickr</twitter>
<url>https://derickrethans.nl/talks/xdebug-brussels19</url>
<joindin></joindin>
<slide>slides/xdebug/title.xml</slide>
<slide>slides/mongodb/me.xml</slide>
<slide>slides/xdebug/focus-on-xdebug.xml</slide>
The Xdebug Experience
17 years
<slide>slides/xdebug/config-settings-2.xml</slide>
<slide>slides/xdebug/breakpoints-2.xml</slide>
<slide>slides/xdebug/port9000.xml</slide>
<!-- <slide>slides/xdebug/connect1.xml</slide> -->
<!-- <slide>slides/xdebug/connect2.xml</slide> -->
<slide>slides/xdebug/debugger-activation.xml</slide>
<slide>slides/xdebug/debugger-connection-log.xml</slide>
<slide>slides/xdebug/xdebug-slow.xml</slide>
<slide>slides/xdebug/test-with-many-versions.xml</slide>
<slide>slides/xdebug/focus-on-xdebug2.xml</slide>
<slide>slides/xdebug/focus-on-xdebug3.xml</slide>
breakpoint behaviour
New versions (7.4)
CI
<!--
<slide>slides/xdebug/xdebug-2.8.xml</slide>
<slide>slides/xdebug/breakpoint-behaviour.xml</slide>
<slide>slides/xdebug/xdebug-ci.xml</slide>
-->
<slide>slides/xdebug/xdebug-3.xml</slide>
Code reorganisation
Modes
- only do what is needed
Reduce Configuration Options
Code Improvements (algorithms, memory, etc)
<slide>slides/xdebug/code-reorgnisation.xml</slide>
<slide>slides/xdebug/modes.xml</slide>
<slide>slides/xdebug/config-settings-3.xml</slide>
<slide>slides/xdebug/config-settings-3b.xml</slide>
<slide>slides/xdebug/xdebug-slow.xml</slide>
<slide>slides/xdebug/xdebug-hard.xml</slide>
<slide>slides/xdebug/donate.xml</slide>
<slide>slides/xdebug/business-support.xml</slide>
<slide>slides/xdebug/transparency.xml</slide>
<slide>slides/xdebug/xdebug-2.9.xml</slide>
<slide>slides/xdebug/cc-speedup.xml</slide>
<!--<slide>slides/xdebug/phpinternalsnews.xml</slide>-->
<slide>slides/mongodb/questions.xml</slide>
<slide>slides/xdebug/resources.xml</slide>
</presentation>