Birmingham PHP, 010PHP, and WebCamp talks

This commit is contained in:
Derick Rethans
2022-10-12 10:55:50 +01:00
parent e19a07d72d
commit 1fba5eb983
16 changed files with 496 additions and 31 deletions

97
php-010php22.xml Normal file
View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<presentation css="derick.css">
<topic>PHP</topic>
<title>What's New in PHP 8.x</title>
<event>010PHP</event>
<location>Den Haag, The Netherlands</location>
<date>September 21st, 2022</date>
<speaker>Derick Rethans</speaker>
<email>derick@php.net</email>
<twitter>derickr</twitter>
<url>https://derickrethans.nl/talks/php-010php22</url>
<joindin></joindin>
<slide>slides/xdebug/title.xml</slide>
<slide>slides/mongodb/me.xml</slide>
<slide>slides/internals/php80-union-types.xml</slide>
<slide>slides/internals/php80-union-types-phpdoc.xml</slide>
<slide>slides/internals/php80-union-types-new.xml</slide>
<slide>slides/internals/php80-union-types-examples.xml</slide>
<slide>slides/internals/php80-union-types-law.xml</slide>
<!--<s lide>slides/internals/php80-union-types-coercive.xml</slide> -->
Readonly properties 2.0 (https://wiki.php.net/rfc/readonly_properties_v2)
<slide>slides/internals/php81-readonly.xml</slide>
https://wiki.php.net/rfc/readonly_classes
<slide>slides/internals/php82-readonly.xml</slide>
Mixed Type v2
<slide>slides/internals/php80-mixed-types.xml</slide>
PHP 8.0:
https://wiki.php.net/rfc/static_return_type
static return type
<slide>slides/internals/php80-static-return.xml</slide>
Constructor Property Promotion
<slide>slides/internals/php80-cpp-without.xml</slide>
<slide>slides/internals/php80-cpp-with.xml</slide>
<slide>slides/internals/php80-named-without.xml</slide>
<slide>slides/internals/php80-named-with.xml</slide>
<!-- BIG NEW FEATURES -->
Enumerations (https://wiki.php.net/rfc/enumerations)
<slide>slides/internals/php81-enums-1.xml</slide>
<slide>slides/internals/php81-enums-2.xml</slide>
<slide>slides/internals/php81-enums-3.xml</slide>
<slide>slides/internals/php81-enums-4.xml</slide>
<slide>slides/internals/php81-enums-5.xml</slide>
<slide>slides/internals/php81-enums-6.xml</slide>
<slide>slides/internals/php81-enums-7.xml</slide>
https://wiki.php.net/rfc/fetch_property_in_const_expressions
<slide>slides/internals/php82-enums-1.xml</slide>
Noreturn type (https://wiki.php.net/rfc/noreturn_type) (never)
<slide>slides/internals/php81-never-type.xml</slide>
Pure Intersection Types (https://wiki.php.net/rfc/pure-intersection-types)
<slide>slides/internals/php81-pure-intersection.xml</slide>
Array unpacking with string keys (https://wiki.php.net/rfc/array_unpacking_string_keys)
<slide>slides/internals/php81-array-unpacking.xml</slide>
Fibers (https://wiki.php.net/rfc/fibers)
<slide>slides/internals/php81-fibers.xml</slide>
First Class Callable (https://wiki.php.net/rfc/first_class_callable_syntax)
<slide>slides/internals/php81-fcc.xml</slide>
PHP 8.2:
https://wiki.php.net/rfc/null-false-standalone-types
'null' and 'false' as standalone
<slide>slides/internals/php82-null-false-standalone.xml</slide>
https://wiki.php.net/rfc/true-type
'true' type
<slide>slides/internals/php82-true.xml</slide>
https://wiki.php.net/rfc/dnf_types
? Disjunctive Normal Form Types
<slide>slides/internals/php82-dnf-types.xml</slide>
https://wiki.php.net/rfc/deprecate_dynamic_properties
<slide>slides/internals/php82-deprecate-dynamic-properties.xml</slide>
https://wiki.php.net/rfc/redact_parameters_in_back_traces
<slide>slides/internals/php82-redact-parameters.xml</slide>
<slide>slides/xdebug/phpinternalsnews.xml</slide>
<slide>slides/internals/questions-new.xml</slide>
<slide>slides/xdebug/resources.xml</slide>
</presentation>

97
php-brumphp22.xml Normal file
View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<presentation css="derick.css">
<topic>PHP</topic>
<title>What's New in PHP 8.1/8.2</title>
<event>BrumPHP</event>
<location>Birmingham, United Kingdom</location>
<date>October 13th, 2022</date>
<speaker>Derick Rethans</speaker>
<email>derick@php.net</email>
<twitter>derickr</twitter>
<url>https://derickrethans.nl/talks/php-brumphp22</url>
<joindin></joindin>
<slide>slides/xdebug/title.xml</slide>
<slide>slides/mongodb/me.xml</slide>
<slide>slides/internals/php80-union-types.xml</slide>
<slide>slides/internals/php80-union-types-phpdoc.xml</slide>
<slide>slides/internals/php80-union-types-new.xml</slide>
<slide>slides/internals/php80-union-types-examples.xml</slide>
<slide>slides/internals/php80-union-types-law.xml</slide>
<!--<s lide>slides/internals/php80-union-types-coercive.xml</slide> -->
Readonly properties 2.0 (https://wiki.php.net/rfc/readonly_properties_v2)
<slide>slides/internals/php81-readonly.xml</slide>
https://wiki.php.net/rfc/readonly_classes
<slide>slides/internals/php82-readonly.xml</slide>
Mixed Type v2
<slide>slides/internals/php80-mixed-types.xml</slide>
PHP 8.0:
https://wiki.php.net/rfc/static_return_type
static return type
<!-- <s lide>slides/internals/php80-static-return.xml</slide> -->
Constructor Property Promotion
<slide>slides/internals/php80-cpp-without.xml</slide>
<slide>slides/internals/php80-cpp-with.xml</slide>
<slide>slides/internals/php80-named-without.xml</slide>
<slide>slides/internals/php80-named-with.xml</slide>
<!-- BIG NEW FEATURES -->
Enumerations (https://wiki.php.net/rfc/enumerations)
<slide>slides/internals/php81-enums-1.xml</slide>
<slide>slides/internals/php81-enums-2.xml</slide>
<slide>slides/internals/php81-enums-3.xml</slide>
<slide>slides/internals/php81-enums-4.xml</slide>
<slide>slides/internals/php81-enums-5.xml</slide>
<!-- <s lide>slides/internals/php81-enums-6.xml</slide> -->
<slide>slides/internals/php81-enums-7.xml</slide>
https://wiki.php.net/rfc/fetch_property_in_const_expressions
<slide>slides/internals/php82-enums-1.xml</slide>
Noreturn type (https://wiki.php.net/rfc/noreturn_type) (never)
<slide>slides/internals/php81-never-type.xml</slide>
Pure Intersection Types (https://wiki.php.net/rfc/pure-intersection-types)
<slide>slides/internals/php81-pure-intersection.xml</slide>
Array unpacking with string keys (https://wiki.php.net/rfc/array_unpacking_string_keys)
<slide>slides/internals/php81-array-unpacking.xml</slide>
Fibers (https://wiki.php.net/rfc/fibers)
<slide>slides/internals/php81-fibers.xml</slide>
First Class Callable (https://wiki.php.net/rfc/first_class_callable_syntax)
<slide>slides/internals/php81-fcc.xml</slide>
PHP 8.2:
https://wiki.php.net/rfc/null-false-standalone-types
'null' and 'false' as standalone
<slide>slides/internals/php82-null-false-standalone.xml</slide>
https://wiki.php.net/rfc/true-type
'true' type
<slide>slides/internals/php82-true.xml</slide>
https://wiki.php.net/rfc/dnf_types
? Disjunctive Normal Form Types
<slide>slides/internals/php82-dnf-types.xml</slide>
https://wiki.php.net/rfc/deprecate_dynamic_properties
<slide>slides/internals/php82-deprecate-dynamic-properties.xml</slide>
https://wiki.php.net/rfc/redact_parameters_in_back_traces
<slide>slides/internals/php82-redact-parameters.xml</slide>
<slide>slides/xdebug/phpinternalsnews.xml</slide>
<slide>slides/internals/questions-new.xml</slide>
<slide>slides/xdebug/resources.xml</slide>
</presentation>

112
php-webcamp22.xml Normal file
View File

@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<presentation css="derick.css">
<topic>PHP</topic>
<title>Debugging PHP 8 Features</title>
<event>Web Summer Camp</event>
<location>Sibenik, Croatia</location>
<date>September 1st, 2022</date>
<speaker>Derick Rethans</speaker>
<email>derick@php.net</email>
<twitter>derickr</twitter>
<url>https://derickrethans.nl/talks/php-webcamp22</url>
<joindin></joindin>
<slide>slides/xdebug/title.xml</slide>
<slide>slides/mongodb/me.xml</slide>
<slide>slides/internals/webcamp22-agenda.xml</slide>
<slide>slides/internals/php80-union-types.xml</slide>
<slide>slides/internals/php80-union-types-phpdoc.xml</slide>
<slide>slides/internals/php80-union-types-new.xml</slide>
<slide>slides/internals/php80-union-types-examples.xml</slide>
<slide>slides/internals/php80-union-types-law.xml</slide>
<slide>slides/internals/php80-union-types-coercive.xml</slide>
Readonly properties 2.0 (https://wiki.php.net/rfc/readonly_properties_v2)
<slide>slides/internals/php81-readonly.xml</slide>
https://wiki.php.net/rfc/readonly_classes
<slide>slides/internals/php82-readonly.xml</slide>
Mixed Type v2
<slide>slides/internals/php80-mixed-types.xml</slide>
PHP 8.0:
https://wiki.php.net/rfc/static_return_type
static return type
<slide>slides/internals/php80-static-return.xml</slide>
Constructor Property Promotion
<slide>slides/internals/php80-cpp-without.xml</slide>
<slide>slides/internals/php80-cpp-with.xml</slide>
<slide>slides/internals/php80-named-without.xml</slide>
<slide>slides/internals/php80-named-with.xml</slide>
PHP 8.1:
Static Variables in Inherited Methods (https://wiki.php.net/rfc/static_variable_inheritance)
<slide>slides/internals/php81-static-vars.xml</slide>
<slide>slides/internals/webcamp22-exercise-static-vars-debug.xml</slide>
New in Initialisers (https://wiki.php.net/rfc/new_in_initializers)
<slide>slides/internals/php81-new-in-initialisers.xml</slide>
<slide>slides/internals/php81-new-in-initialisers-locations.xml</slide>
<!-- BIG NEW FEATURES -->
Enumerations (https://wiki.php.net/rfc/enumerations)
<slide>slides/internals/php81-enums-1.xml</slide>
<slide>slides/internals/php81-enums-2.xml</slide>
<slide>slides/internals/php81-enums-3.xml</slide>
<slide>slides/internals/php81-enums-4.xml</slide>
<slide>slides/internals/php81-enums-5.xml</slide>
<slide>slides/internals/php81-enums-6.xml</slide>
<slide>slides/internals/php81-enums-7.xml</slide>
https://wiki.php.net/rfc/fetch_property_in_const_expressions
<slide>slides/internals/php82-enums-1.xml</slide>
Noreturn type (https://wiki.php.net/rfc/noreturn_type) (never)
<slide>slides/internals/php81-never-type.xml</slide>
Pure Intersection Types (https://wiki.php.net/rfc/pure-intersection-types)
<slide>slides/internals/php81-pure-intersection.xml</slide>
Array unpacking with string keys (https://wiki.php.net/rfc/array_unpacking_string_keys)
<slide>slides/internals/php81-array-unpacking.xml</slide>
Fibers (https://wiki.php.net/rfc/fibers)
<slide>slides/internals/php81-fibers.xml</slide>
<slide>slides/internals/webcamp22-exercise-fibers.xml</slide>
Final class constants (https://wiki.php.net/rfc/final_class_const)
<slide>slides/internals/php81-final-class-constants.xml</slide>
PHP 8.2:
https://wiki.php.net/rfc/null-false-standalone-types
'null' and 'false' as standalone
<slide>slides/internals/php82-null-false-standalone.xml</slide>
https://wiki.php.net/rfc/true-type
'true' type
<slide>slides/internals/php82-true.xml</slide>
https://wiki.php.net/rfc/dnf_types
? Disjunctive Normal Form Types
<slide>slides/internals/php82-dnf-types.xml</slide>
https://wiki.php.net/rfc/deprecate_dynamic_properties
<slide>slides/internals/php82-deprecate-dynamic-properties.xml</slide>
https://wiki.php.net/rfc/redact_parameters_in_back_traces
<slide>slides/internals/php82-redact-parameters.xml</slide>
<slide>slides/xdebug/phpinternalsnews.xml</slide>
<slide>slides/internals/questions-new.xml</slide>
<slide>slides/xdebug/resources.xml</slide>
</presentation>

View File

@@ -17,7 +17,7 @@ class Settings
<div effect="fade-in">
<blurb>Instantiation with different includes:</blurb>
<example inline="2">
$settings = new \Settings(*includeDistillery: false*);
$settings = new \Settings(*includeDescription: false*);
</example>
</div>
<div effect="fade-in">

View File

@@ -17,7 +17,7 @@ class Settings
<div effect="fade-in">
<blurb>Instantiation with different includes:</blurb>
<example inline="1">
$settings = new \Settings(*false*, true, false);
$settings = new \Settings(true, *false*);
</example>
</div>
<div effect="fade-in">

View File

@@ -26,14 +26,11 @@ var_dump( $elephpant );
</div>
<div effect="fade-in">
<break lines="2"/>
<example inline="1">class Product#1 (3) {
private string $name => string(6) "Chilli"
private float $amount => double(5.5)
private *Currency* $currency =>
*class Currency*#2 (1) {
public string $name => string(3) "EUR"
}
} </example>
private *Currency* $currency => *enum Currency::EUR*;
}</example>
</div>
</slide>

View File

@@ -16,7 +16,7 @@ class Product {
$elephpant = new Product( 'Chilli', 5.50, *"EUR"* );
]]></example>
</div>
<break/>
<break lines="2"/>
<div effect="fade-in">
<example inline="1">*TypeError: Product::__construct(): Argument #3 ($currency) must be of type Currency,*
*string given, called in /tmp/enum-2.php on line 12 in /tmp/enum-2.php on line 8*

View File

@@ -18,15 +18,11 @@ var_dump( $elephpant );]]></example>
</div>
<div effect="fade-in">
<break lines="2"/>
<example inline="1">class Product#1 (3) {
private string $name => string(6) "Chilli"
private float $amount => double(5.5)
private Currency $currency =>
class Currency#2 (2) {
public string $name => string(3) "GBP"
public string *$value* => string(2) "£"
}
private Currency $currency => enum Currency::GBP *: string("£")*;
}
</example>
</div>

View File

@@ -18,10 +18,7 @@ enum Currency: string {
<div effect="fade-in-out">
<blurb>Create from Value:</blurb>
<example inline="1">var_dump( Currency*::from('£')* );</example>
<example class="result">class Currency#2 (2) {
public string $name => string(3) "GBP"
public string $value => string(2) "£"
}</example>
<example class="result">enum Currency::GBP : string("£");</example>
</div>
<div effect="fade-in">

View File

@@ -15,14 +15,10 @@ enum Currency: string {
<blurb>List Cases:</blurb>
<example inline="1">var_dump( Currency::cases() );</example>
<example class="result" inline="1">array(2) {
[0] => *class* Currency#1 (2) {
public string $name => string(3) "GBP"
public string $value => string(2) "£"
}
[1] => class Currency#2 (2) {
public string $name => string(3) "EUR"
public string $value => string(3) "€"
}
[0]=>
enum(Currency::GBP)
[1]=>
enum(Currency::EUR)
}
</example>
</div>

View File

@@ -0,0 +1,98 @@
<slide>
<title>First Class Callable Syntax</title>
<div effect="fade-out">
<example inline="1">
<![CDATA[&lt?php
class Test {
public function getPrivateMethod() {
*return [$this, 'privateMethod'];*
|aaaaaa|return Closure::fromCallable([$this, 'privateMethod']);|
|aaaaaa|return $this->privateMethod(...);|
}
private function privateMethod() {
echo ___METHOD___, "\n";
}
}
$test = new Test;
$privateMethod = $test->getPrivateMethod();
$privateMethod();
?>]]>
</example>
</div>
<div effect="fade-in-out">
<example inline="1">
<![CDATA[&lt?php
class Test {
public function getPrivateMethod() {
|bbbbbb|return [$this, 'privateMethod'];|
*return Closure::fromCallable([$this, 'privateMethod']);*
|aaaaaa|return $this->privateMethod(...);|
}
private function privateMethod() {
echo ___METHOD___, "\n";
}
}
$test = new Test;
$privateMethod = $test->getPrivateMethod();
$privateMethod();
?>]]>
</example>
</div>
<div effect="fade-in-out">
<example inline="1">
<![CDATA[&lt?php
class Test {
public function getPrivateMethod() {
|bbbbbb|return [$this, 'privateMethod'];*|
|bbbbbb|return Closure::fromCallable([$this, 'privateMethod']);|
*return $this->privateMethod(...);*
}
private function privateMethod() {
echo ___METHOD___, "\n";
}
}
$test = new Test;
$privateMethod = $test->getPrivateMethod();
$privateMethod();
?>]]>
</example>
</div>
<div effect="fade-in">
<blurb>Syntactic Sugar</blurb>
<example>
$fn = Closure::fromCallable('strlen');
$fn = strlen(...);
$fn = Closure::fromCallable([$this, 'method']);
$fn = $this->method(...)
$fn = Closure::fromCallable([Foo::class, 'method']);
$fn = Foo::method(...);
</example>
<break/>
<blurb>Other variants</blurb>
<example>
strlen(...);
$closure(...);
$obj->method(...);
$obj->$methodStr(...);
($obj->property)(...);
Foo::method(...);
$classStr::$methodStr(...);
self::{$complex . $expression}(...);
[$obj, 'method'](...);
[Foo::class, 'method'](...);
</example>
</div>
</slide>

View File

@@ -10,10 +10,10 @@ class A {
}
class B extends A {}
echo A::counter(), ' ',
A::counter(), ' ',
B::counter(), ' ',
B::counter();
echo A::counter(), ' ';
echo A::counter(), ' ';
echo B::counter(), ' ';
echo B::counter();
]]></example>
<blurb>PHP 8.0:</blurb>

View File

@@ -0,0 +1,11 @@
<slide>
<title>Topics</title>
<list>
<bullet>Improvements in PHP's Type System</bullet>
<bullet>Xdebug 3's improvements for debugging</bullet>
<bullet>Complicated new PHP features and changes</bullet>
<bullet>Exercises!</bullet>
</list>
</slide>

View File

@@ -0,0 +1,25 @@
<slide>
<title>Show and Tell: %Fibers%</title>
<blurb>*Everyone*:</blurb>
<list>
<bullet>Open %fibers.php%</bullet>
</list>
<break/>
<blurb>*VS Code*:</blurb>
<list>
<bullet>Click green triangle / %F5% to start listening</bullet>
</list>
<break/>
<blurb>*PhpStorm*</blurb>
<list>
<bullet>Click: %Run%, %Start Listening for PHP Debug Connections%</bullet>
</list>
<break/>
<blurb>*Everyone*:</blurb>
<list>
<bullet>Open %http://localhost:8123/fibers.php% in browser</bullet>
</list>
</slide>

View File

@@ -0,0 +1,38 @@
<slide>
<title>Exercise</title>
<div effect="fade-out">
<list>
<bullet>GIT checkout: %https://github.com/derickr/workshop-webcamp22%</bullet>
<bullet>Run: %docker compose up%</bullet>
<bullet>Go to: %http://localhost:8123/info.php%</bullet>
<bullet>Let's go through the output...</bullet>
</list>
</div>
<div effect="fade-in-out">
<list>
<bullet>Fix permissions of %logs% directory to make it writeable to all</bullet>
<bullet>Refresh browser (%http://localhost:8123/info.php%)</bullet>
<bullet>Check output of log file (%./logs/xdebug.log%)</bullet>
<bullet>Start VS Code or PhpStorm</bullet>
</list>
</div>
<div effect="fade-in">
<blurb>*VS Code*:</blurb>
<list>
<bullet>Open the GIT checkout folder</bullet>
<bullet>Open "Run and Debug" (%Ctrl-Shift-D%)</bullet>
<bullet>Click "create a launch.json file"</bullet>
<bullet>Open %static-properties.php%</bullet>
<bullet>Click green triangle / %F5% to start listening</bullet>
</list>
<break/>
<blurb>*PhpStorm*</blurb>
<list>
<bullet>Click: %File%, %New Project From Existing Files%</bullet>
<bullet>Select %Source files are in a local...configured%</bullet>
<bullet>Select workshop folder</bullet>
<bullet>Open %static-properties.php%</bullet>
<bullet>Click: %Run%, %Start Listening for PHP Debug Connections%</bullet>
</list>
</div>
</slide>

View File

@@ -8,6 +8,7 @@
<list>
<bullet>I'm European, living in London</bullet>
<bullet>PHP 7.4 *Release Manager*</bullet>
<bullet>*PHP Foundation*</bullet>
<bullet>*Xdebug* &amp; PHP's Date/Time support</bullet>
<bullet>Host of *https://phpinternals.news* podcast</bullet>
<bullet>I ♥🌍 maps, I ♥🍺 beer, I ♥🥃 whisky</bullet>