mirror of
https://github.com/php/presentations.git
synced 2026-03-23 23:22:22 +01:00
PHP 7.0/7.1 talk for BrightonPHP
This commit is contained in:
71
php7-brightonphp16.xml
Normal file
71
php7-brightonphp16.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<presentation css="10gen-strict.css">
|
||||
<topic>PHP</topic>
|
||||
<title>PHP 7 (and 7.1)</title>
|
||||
<event>Brighton PHP</event>
|
||||
<location>Brighton, UK</location>
|
||||
<date>Nov 21st, 2016</date>
|
||||
<speaker>Derick Rethans</speaker>
|
||||
<email>derick@php.net</email>
|
||||
<twitter>derickr</twitter>
|
||||
<url>http://derickrethans.nl/talks.html</url>
|
||||
<joindin></joindin>
|
||||
<slide>slides/mongodb/title.xml</slide>
|
||||
<slide>slides/mongodb/me.xml</slide>
|
||||
|
||||
<!-- new features -->
|
||||
<slide>slides/intro/php7-engine-improv.xml</slide>
|
||||
<slide>slides/intro/php-versions-bench.xml</slide>
|
||||
<slide>slides/intro/php7-opcache-persist.xml</slide>
|
||||
<slide>slides/intro/php7-opcache-composer.xml</slide>
|
||||
<slide>slides/intro/php7-opcache-tree.xml</slide>
|
||||
|
||||
<slide>slides/intro/php7-ast.xml</slide>
|
||||
<slide>slides/intro/php7-fatal-exception.xml</slide>
|
||||
<slide>slides/intro/php7-exception-hiearchy.xml</slide>
|
||||
|
||||
<slide>slides/intro/php7-types-return.xml</slide>
|
||||
<slide>slides/intro/php7-types-coercive.xml</slide>
|
||||
<slide>slides/intro/php7-types-strict.xml</slide>
|
||||
|
||||
<slide>slides/intro/php7-anon-class.xml</slide>
|
||||
<slide>slides/intro/php7-coalesce.xml</slide>
|
||||
<slide>slides/intro/php7-spaceship.xml</slide>
|
||||
<slide>slides/intro/php7-enterprise.xml</slide>
|
||||
<slide>slides/intro/php7-0cost-assertions.xml</slide>
|
||||
|
||||
<slide>slides/intro/php7-sizet.xml</slide>
|
||||
<slide>slides/intro/php7-uvs.xml</slide>
|
||||
<slide>slides/intro/php7-unicode.xml</slide>
|
||||
<slide>slides/intro/php7-csprng.xml</slide>
|
||||
|
||||
<slide>slides/intro/php7-bench-drupal8.xml</slide>
|
||||
<slide>slides/intro/php7-mem-drupal8.xml</slide>
|
||||
<slide>slides/intro/php7-bench-wp411.xml</slide>
|
||||
<slide>slides/intro/php7-mem-wp411.xml</slide>
|
||||
<slide>slides/intro/php7-bench-magento2-dev.xml</slide>
|
||||
<slide>slides/intro/php7-bench-mediawiki124.xml</slide>
|
||||
<slide>slides/intro/php7-bench-phpbb313.xml</slide>
|
||||
|
||||
<slide>slides/intro/php7-speedy-elephpant.xml</slide>
|
||||
|
||||
<slide>slides/intro/php7-badoo-1.xml</slide>
|
||||
<slide>slides/intro/php7-badoo-2.xml</slide>
|
||||
<slide>slides/intro/php7-badoo-3.xml</slide>
|
||||
|
||||
<slide>slides/intro/php71-title.xml</slide>
|
||||
|
||||
<slide>slides/intro/php71-nullable.xml</slide>
|
||||
<slide>slides/intro/php71-void-return.xml</slide>
|
||||
<slide>slides/intro/php71-list-keys.xml</slide>
|
||||
<slide>slides/intro/php71-list-syntax.xml</slide>
|
||||
<slide>slides/intro/php71-class-constants.xml</slide>
|
||||
<slide>slides/intro/php71-negative-string-index.xml</slide>
|
||||
<slide>slides/intro/php71-iterable-psuedo-type.xml</slide>
|
||||
<slide>slides/intro/php71-microseconds.xml</slide>
|
||||
|
||||
|
||||
<slide>slides/mongodb/resources.xml</slide>
|
||||
|
||||
|
||||
</presentation>
|
||||
BIN
slides/intro/badoo-load.png
Normal file
BIN
slides/intro/badoo-load.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 280 KiB |
BIN
slides/intro/badoo-mem.png
Normal file
BIN
slides/intro/badoo-mem.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 178 KiB |
BIN
slides/intro/badoo-rusage.png
Normal file
BIN
slides/intro/badoo-rusage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 194 KiB |
BIN
slides/intro/future.jpg
Normal file
BIN
slides/intro/future.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
5
slides/intro/php7-badoo-1.xml
Normal file
5
slides/intro/php7-badoo-1.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<slide>
|
||||
<title>PHP 7 at Badoo</title>
|
||||
|
||||
<image filename="badoo-rusage.png" attr="https://techblog.badoo.com/blog/2016/03/14/how-badoo-saved-one-million-dollars-switching-to-php7/"/>
|
||||
</slide>
|
||||
5
slides/intro/php7-badoo-2.xml
Normal file
5
slides/intro/php7-badoo-2.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<slide>
|
||||
<title>PHP 7 at Badoo</title>
|
||||
|
||||
<image filename="badoo-mem.png" attr="https://techblog.badoo.com/blog/2016/03/14/how-badoo-saved-one-million-dollars-switching-to-php7/"/>
|
||||
</slide>
|
||||
5
slides/intro/php7-badoo-3.xml
Normal file
5
slides/intro/php7-badoo-3.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<slide>
|
||||
<title>PHP 7 at Badoo</title>
|
||||
|
||||
<image filename="badoo-load.png" attr="https://techblog.badoo.com/blog/2016/03/14/how-badoo-saved-one-million-dollars-switching-to-php7/"/>
|
||||
</slide>
|
||||
25
slides/intro/php71-class-constants.xml
Normal file
25
slides/intro/php71-class-constants.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<slide>
|
||||
<image filename="php7trans-200.png" />
|
||||
<break/>
|
||||
|
||||
<blurb>✔ Class Constant Visibility</blurb>
|
||||
<example><![CDATA[
|
||||
<?php
|
||||
class Token {
|
||||
// Constants default to public
|
||||
const PUBLIC_CONST = 0;
|
||||
|
||||
// Constants then also can have a defined visibility
|
||||
private const PRIVATE_CONST = 0;
|
||||
protected const PROTECTED_CONST = 0;
|
||||
public const PUBLIC_CONST_TWO = 0;
|
||||
|
||||
// Both FOO and BAR are "private const"
|
||||
private const FOO = 1, BAR = 2;
|
||||
}
|
||||
?>
|
||||
]]></example>
|
||||
<blurb>Constants can only have one visibility declaration list</blurb>
|
||||
<blurb>Interfaces only support public constants</blurb>
|
||||
|
||||
</slide>
|
||||
26
slides/intro/php71-iterable-psuedo-type.xml
Normal file
26
slides/intro/php71-iterable-psuedo-type.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<slide>
|
||||
<image filename="php7trans-200.png" />
|
||||
<break/>
|
||||
|
||||
<blurb>✔ %Iterable% psuedo-type</blurb>
|
||||
<example><![CDATA[<?php
|
||||
function foo( iterable $iterable )
|
||||
{
|
||||
foreach ( $iterable as $value )
|
||||
{
|
||||
// ...
|
||||
}
|
||||
}
|
||||
?>]]></example>
|
||||
<blurb>%array% or instance of %Traversable%</blurb>
|
||||
|
||||
<blurb>✔ Generators are also Iterable</blurb>
|
||||
<example><![CDATA[<?php
|
||||
function gen(): iterable
|
||||
{
|
||||
yield 1;
|
||||
yield 2;
|
||||
yield 3;
|
||||
}]]></example>
|
||||
|
||||
</slide>
|
||||
20
slides/intro/php71-list-keys.xml
Normal file
20
slides/intro/php71-list-keys.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<slide>
|
||||
<image filename="php7trans-200.png" />
|
||||
<break/>
|
||||
|
||||
<blurb>✔ Keys in %list% Assignment</blurb>
|
||||
<example><![CDATA[
|
||||
<?php
|
||||
$points = [
|
||||
[ "x" => 1, "y" => 2, "z" => 4 ],
|
||||
[ "x" => 2, "y" => 1 ],
|
||||
];
|
||||
|
||||
foreach ( $points as list( "x" => $x, "y" => $y ) )
|
||||
{
|
||||
echo "Point at ($x, $y)", PHP_EOL;
|
||||
}
|
||||
?>
|
||||
]]></example>
|
||||
|
||||
</slide>
|
||||
27
slides/intro/php71-list-syntax.xml
Normal file
27
slides/intro/php71-list-syntax.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<slide>
|
||||
<image filename="php7trans-200.png" />
|
||||
<break/>
|
||||
|
||||
<blurb>✔ Square Bracket for Array Destructoring</blurb>
|
||||
|
||||
<blurb>With %list()%:</blurb>
|
||||
<example><![CDATA[
|
||||
<?php
|
||||
list( $a, $b, $c ) = $array;
|
||||
|
||||
list( "a" => $a, "b" => $b, "c" => $c ) = $array;
|
||||
?>
|
||||
]]></example>
|
||||
|
||||
<break/>
|
||||
|
||||
<blurb>With %[ ]%:</blurb>
|
||||
<example><![CDATA[
|
||||
<?php
|
||||
[ $a, $b, $c ] = $array;
|
||||
|
||||
[ "a" => $a, "b" => $b, "c" => $c ] = $array;
|
||||
?>
|
||||
]]></example>
|
||||
|
||||
</slide>
|
||||
22
slides/intro/php71-microseconds.xml
Normal file
22
slides/intro/php71-microseconds.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<slide>
|
||||
<image filename="php7trans-200.png" />
|
||||
<break/>
|
||||
|
||||
<blurb>✔ Microseconds Support Improved</blurb>
|
||||
<example><![CDATA[
|
||||
<?php
|
||||
$now = new DateTimeImmutable();
|
||||
echo $now->format( 'H:i:s.u' ), "\n";
|
||||
?>
|
||||
]]></example>
|
||||
<blurb>%15:52:27.340830%</blurb>
|
||||
|
||||
<blurb>Be aware:</blurb>
|
||||
<example><![CDATA[
|
||||
<?php
|
||||
var_dump( new DateTimeImmutable() == new DateTimeImmutable() );
|
||||
?>
|
||||
]]></example>
|
||||
|
||||
|
||||
</slide>
|
||||
18
slides/intro/php71-negative-string-index.xml
Normal file
18
slides/intro/php71-negative-string-index.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<slide>
|
||||
<image filename="php7trans-200.png" />
|
||||
<break/>
|
||||
|
||||
<blurb>✔ Negative String Offsets</blurb>
|
||||
<example><![CDATA[
|
||||
$str = 'abcdef';
|
||||
var_dump( $str[ -2 ] ); // => string(1) "e"
|
||||
|
||||
$str{-3} = '.';
|
||||
var_dump( $str ); // => string(6) "abc.ef"
|
||||
|
||||
var_dump( isset( $str{-4} ) ); // => bool(true)
|
||||
|
||||
var_dump( isset( $str{-10} ) ); // => bool(false)
|
||||
]]></example>
|
||||
|
||||
</slide>
|
||||
26
slides/intro/php71-nullable.xml
Normal file
26
slides/intro/php71-nullable.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<slide>
|
||||
<image filename="php7trans-200.png" />
|
||||
<break/>
|
||||
|
||||
<blurb>✔ Nullable types</blurb>
|
||||
<example><![CDATA[<?php
|
||||
function say(?string $msg) {
|
||||
if ($msg) {
|
||||
echo $msg;
|
||||
}
|
||||
}
|
||||
|
||||
function findElephpant( $name ) : ?Elephpant
|
||||
{
|
||||
if ( ( $elephpant = findElephpantInDB( $name ) ) == FALSE )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return $elephpant;
|
||||
}
|
||||
?>]]></example>
|
||||
|
||||
<blurb>%= null% implies %?% type hint</blurb>
|
||||
|
||||
</slide>
|
||||
4
slides/intro/php71-title.xml
Normal file
4
slides/intro/php71-title.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<slide style="title">
|
||||
<title>7.1</title>
|
||||
<image align="center" filename="future.jpg" attr="NASA, ESA, H. Teplitz and M. Rafelski (IPAC/Caltech), A. Koekemoer (STScI), R. Windhorst (Arizona State University), and Z. Levay (STScI)"/>
|
||||
</slide>
|
||||
15
slides/intro/php71-void-return.xml
Normal file
15
slides/intro/php71-void-return.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<slide>
|
||||
<image filename="php7trans-200.png" />
|
||||
<break/>
|
||||
|
||||
<blurb>✔ Void return type</blurb>
|
||||
<example><![CDATA[
|
||||
function should_return_nothing(): void
|
||||
{
|
||||
// Fatal error: A void function must not return a value
|
||||
return new Elephpant;
|
||||
}
|
||||
]]></example>
|
||||
<blurb>Parser stage, so no Error/Exception</blurb>
|
||||
|
||||
</slide>
|
||||
Reference in New Issue
Block a user