com presentations: PHP 7.0/7.1 talk for BrightonPHP: php7-brightonphp16.xml slides/intro/badoo-load.png slides/intro/badoo-mem.png slides/intro/badoo-rusage.png slides/intro/future.jpg slides/intro/php7-badoo-1.xml slides/intro/php7-badoo-2.xml slides/intro/php7-badoo-3.xml slides/intro/php71-class-constants.xml slides/intro/php71-iterable-psuedo-type.xml slides/intro/php71-list-keys.xml slides/intro/php71-list-syntax.xml slides/intro/php71-micro

[email protected] (Derick Rethans) Mon, 21 Nov 2016 15:55:25 +0000
Newsgroups php.pres
Message-ID <[email protected]>
Commit:    5a0df70360885d604991c403f2c0f4f80fbbe2fd
Author:    Derick Rethans <[email protected]>         Mon, 21 Nov 2016 15:55:25 +0000
Parents:   6719a849b6e11fb048c9532c51304ff0e19666bf
Branches:  master

Link:       http://git.php.net/?p=presentations.git;a=commitdiff;h=5a0df70360885d604991c403f2c0f4f80fbbe2fd

Log:
PHP 7.0/7.1 talk for BrightonPHP

Changed paths:
  A  php7-brightonphp16.xml
  A  slides/intro/badoo-load.png
  A  slides/intro/badoo-mem.png
  A  slides/intro/badoo-rusage.png
  A  slides/intro/future.jpg
  A  slides/intro/php7-badoo-1.xml
  A  slides/intro/php7-badoo-2.xml
  A  slides/intro/php7-badoo-3.xml
  A  slides/intro/php71-class-constants.xml
  A  slides/intro/php71-iterable-psuedo-type.xml
  A  slides/intro/php71-list-keys.xml
  A  slides/intro/php71-list-syntax.xml
  A  slides/intro/php71-microseconds.xml
  A  slides/intro/php71-negative-string-index.xml
  A  slides/intro/php71-nullable.xml
  A  slides/intro/php71-title.xml
  A  slides/intro/php71-void-return.xml
diff_5a0df70360885d604991c403f2c0f4f80fbbe2fd.txt (text/plain, 10 KB)
diff --git a/php7-brightonphp16.xml b/php7-brightonphp16.xml
new file mode 100644
index 0000000..d9d26d0
--- /dev/null
+++ b/php7-brightonphp16.xml
@@ -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>[email protected]</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>
diff --git a/slides/intro/badoo-load.png b/slides/intro/badoo-load.png
new file mode 100644
index 0000000..8456999
Binary files /dev/null and b/slides/intro/badoo-load.png differ
diff --git a/slides/intro/badoo-mem.png b/slides/intro/badoo-mem.png
new file mode 100644
index 0000000..1764653
Binary files /dev/null and b/slides/intro/badoo-mem.png differ
diff --git a/slides/intro/badoo-rusage.png b/slides/intro/badoo-rusage.png
new file mode 100644
index 0000000..f99e12a
Binary files /dev/null and b/slides/intro/badoo-rusage.png differ
diff --git a/slides/intro/future.jpg b/slides/intro/future.jpg
new file mode 100644
index 0000000..e495bc2
Binary files /dev/null and b/slides/intro/future.jpg differ
diff --git a/slides/intro/php7-badoo-1.xml b/slides/intro/php7-badoo-1.xml
new file mode 100644
index 0000000..e1cce33
--- /dev/null
+++ b/slides/intro/php7-badoo-1.xml
@@ -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>
diff --git a/slides/intro/php7-badoo-2.xml b/slides/intro/php7-badoo-2.xml
new file mode 100644
index 0000000..2824af2
--- /dev/null
+++ b/slides/intro/php7-badoo-2.xml
@@ -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>
diff --git a/slides/intro/php7-badoo-3.xml b/slides/intro/php7-badoo-3.xml
new file mode 100644
index 0000000..8c22a3a
--- /dev/null
+++ b/slides/intro/php7-badoo-3.xml
@@ -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>
diff --git a/slides/intro/php71-class-constants.xml b/slides/intro/php71-class-constants.xml
new file mode 100644
index 0000000..eab66a4
--- /dev/null
+++ b/slides/intro/php71-class-constants.xml
@@ -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>
diff --git a/slides/intro/php71-iterable-psuedo-type.xml b/slides/intro/php71-iterable-psuedo-type.xml
new file mode 100644
index 0000000..367f1d3
--- /dev/null
+++ b/slides/intro/php71-iterable-psuedo-type.xml
@@ -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>
diff --git a/slides/intro/php71-list-keys.xml b/slides/intro/php71-list-keys.xml
new file mode 100644
index 0000000..e335f46
--- /dev/null
+++ b/slides/intro/php71-list-keys.xml
@@ -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>
diff --git a/slides/intro/php71-list-syntax.xml b/slides/intro/php71-list-syntax.xml
new file mode 100644
index 0000000..7428a5d
--- /dev/null
+++ b/slides/intro/php71-list-syntax.xml
@@ -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>
diff --git a/slides/intro/php71-microseconds.xml b/slides/intro/php71-microseconds.xml
new file mode 100644
index 0000000..8e31a34
--- /dev/null
+++ b/slides/intro/php71-microseconds.xml
@@ -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>
diff --git a/slides/intro/php71-negative-string-index.xml b/slides/intro/php71-negative-string-index.xml
new file mode 100644
index 0000000..a3af4a0
--- /dev/null
+++ b/slides/intro/php71-negative-string-index.xml
@@ -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>
diff --git a/slides/intro/php71-nullable.xml b/slides/intro/php71-nullable.xml
new file mode 100644
index 0000000..01b36ff
--- /dev/null
+++ b/slides/intro/php71-nullable.xml
@@ -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>
diff --git a/slides/intro/php71-title.xml b/slides/intro/php71-title.xml
new file mode 100644
index 0000000..72ef05c
--- /dev/null
+++ b/slides/intro/php71-title.xml
@@ -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>
diff --git a/slides/intro/php71-void-return.xml b/slides/intro/php71-void-return.xml
new file mode 100644
index 0000000..f0f61ce
--- /dev/null
+++ b/slides/intro/php71-void-return.xml
@@ -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>