com presentations: Added PHP 7 talk from PHP London (December): php7-phplondon15.xml slides/intro/bench-drupal8.png slides/intro/bench-magento2-dev.png slides/intro/bench-mediawiki124.png slides/intro/bench-phpbb313.png slides/intro/bench-wp411.png slides/intro/benchmarks.png slides/intro/elephpant-php7-trans.png slides/intro/mem-drupal8.png slides/intro/mem-wp411.png slides/intro/php-benchmarks.png slides/intro/php-enterprise.jpg slides/intro/ph
[email protected] (Derick Rethans) Tue, 26 Jan 2016 11:54:05 +0000
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Commit: 911b7fcf24b4a232d64675452b7fe23de1ec4a20 Author: Derick Rethans <[email protected]> Tue, 26 Jan 2016 11:54:05 +0000 Parents: 22e92ad8a346bec9151e4166ed24fee5e3e41f23 Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=911b7fcf24b4a232d64675452b7fe23de1ec4a20 Log: Added PHP 7 talk from PHP London (December) Changed paths: A php7-phplondon15.xml A slides/intro/bench-drupal8.png A slides/intro/bench-magento2-dev.png A slides/intro/bench-mediawiki124.png A slides/intro/bench-phpbb313.png A slides/intro/bench-wp411.png A slides/intro/benchmarks.png A slides/intro/elephpant-php7-trans.png A slides/intro/mem-drupal8.png A slides/intro/mem-wp411.png A slides/intro/php-benchmarks.png A slides/intro/php-enterprise.jpg A slides/intro/php-versions-bench.xml A slides/intro/php7-0cost-assertions.xml A slides/intro/php7-anon-class.xml A slides/intro/php7-ast.xml A slides/intro/php7-bench-drupal8.xml A slides/intro/php7-bench-magento2-dev.xml A slides/intro/php7-bench-mediawiki124.xml A slides/intro/php7-bench-phpbb313.xml A slides/intro/php7-bench-wp411.xml A slides/intro/php7-coalesce.xml A slides/intro/php7-csprng.xml A slides/intro/php7-engine-improv.xml A slides/intro/php7-enterprise.xml A slides/intro/php7-exception-hiearchy.xml A slides/intro/php7-exception-hierachy.xml A slides/intro/php7-fatal-exception.xml A slides/intro/php7-mem-drupal8.xml A slides/intro/php7-mem-wp411.xml A slides/intro/php7-opcache-composer.xml A slides/intro/php7-opcache-persist.xml A slides/intro/php7-opcache-tree.xml A slides/intro/php7-perf-memory-size.xml A slides/intro/php7-perf-others.xml A slides/intro/php7-perf-wp-inst.xml A slides/intro/php7-sizet.xml A slides/intro/php7-spaceship.xml A slides/intro/php7-speedy-elephpant.xml A slides/intro/php7-types-coercive.xml A slides/intro/php7-types-return.xml A slides/intro/php7-types-strict.xml A slides/intro/php7-unicode.xml A slides/intro/php7-uvs.xml A slides/intro/tieadvancedx1.jpg A slides/intro/wp-instructions.png A templates/default/literal.ezt
diff_911b7fcf24b4a232d64675452b7fe23de1ec4a20.txt
(text/plain, 30.9 KB)
diff --git a/php7-phplondon15.xml b/php7-phplondon15.xml new file mode 100644 index 0000000..3b4307a --- /dev/null +++ b/php7-phplondon15.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen-strict.css"> +<topic>PHP</topic> +<title>PHP 7</title> +<event>PHP London</event> +<location>London, UK</location> +<date>Oct 27th, 2015</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/mongodb/resources.xml</slide> + + +</presentation> diff --git a/slides/intro/bench-drupal8.png b/slides/intro/bench-drupal8.png new file mode 100644 index 0000000..5bea9ab Binary files /dev/null and b/slides/intro/bench-drupal8.png differ diff --git a/slides/intro/bench-magento2-dev.png b/slides/intro/bench-magento2-dev.png new file mode 100644 index 0000000..50e2dfa Binary files /dev/null and b/slides/intro/bench-magento2-dev.png differ diff --git a/slides/intro/bench-mediawiki124.png b/slides/intro/bench-mediawiki124.png new file mode 100644 index 0000000..ac6bfad Binary files /dev/null and b/slides/intro/bench-mediawiki124.png differ diff --git a/slides/intro/bench-phpbb313.png b/slides/intro/bench-phpbb313.png new file mode 100644 index 0000000..b00066d Binary files /dev/null and b/slides/intro/bench-phpbb313.png differ diff --git a/slides/intro/bench-wp411.png b/slides/intro/bench-wp411.png new file mode 100644 index 0000000..34643f9 Binary files /dev/null and b/slides/intro/bench-wp411.png differ diff --git a/slides/intro/benchmarks.png b/slides/intro/benchmarks.png new file mode 100644 index 0000000..7f97c11 Binary files /dev/null and b/slides/intro/benchmarks.png differ diff --git a/slides/intro/elephpant-php7-trans.png b/slides/intro/elephpant-php7-trans.png new file mode 100644 index 0000000..24462b9 Binary files /dev/null and b/slides/intro/elephpant-php7-trans.png differ diff --git a/slides/intro/mem-drupal8.png b/slides/intro/mem-drupal8.png new file mode 100644 index 0000000..de0ed68 Binary files /dev/null and b/slides/intro/mem-drupal8.png differ diff --git a/slides/intro/mem-wp411.png b/slides/intro/mem-wp411.png new file mode 100644 index 0000000..27a7021 Binary files /dev/null and b/slides/intro/mem-wp411.png differ diff --git a/slides/intro/php-benchmarks.png b/slides/intro/php-benchmarks.png new file mode 100644 index 0000000..e8b04ae Binary files /dev/null and b/slides/intro/php-benchmarks.png differ diff --git a/slides/intro/php-enterprise.jpg b/slides/intro/php-enterprise.jpg new file mode 100644 index 0000000..07053a0 Binary files /dev/null and b/slides/intro/php-enterprise.jpg differ diff --git a/slides/intro/php-versions-bench.xml b/slides/intro/php-versions-bench.xml new file mode 100644 index 0000000..ee9010f --- /dev/null +++ b/slides/intro/php-versions-bench.xml @@ -0,0 +1,4 @@ +<slide> + +<image align="center" filename="php-benchmarks.png"/> +</slide> diff --git a/slides/intro/php7-0cost-assertions.xml b/slides/intro/php7-0cost-assertions.xml new file mode 100644 index 0000000..84d2a36 --- /dev/null +++ b/slides/intro/php7-0cost-assertions.xml @@ -0,0 +1,30 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Zero-cost Assertions</blurb> +<example><![CDATA[ +<?php +function test($arg) { + assert($arg > 20 && $arg < 110, "$arg is invalid"); +} +ini_set('zend.assertions',0); test(16); +ini_set('zend.assertions',1); test(17); +ini_set('assert.exception',1); test(18); +?>]]></example> +<example><![CDATA[ +Warning: assert(): 17 is invalid failed in file on line 2 +Fatal error: Uncaught AssertionError: 18 is invalid in file:2 +Stack trace: +#0 file(2): assert(false, '18 is invalid') +#1 file(6): test(18) +#2 {main} + thrown in file on line 2 +]]></example> +<example><![CDATA[ +; Completely skip compiling assert() calls +; (can only be set in php.ini) +zend.assertions = -1 +]]></example> + +</slide> diff --git a/slides/intro/php7-anon-class.xml b/slides/intro/php7-anon-class.xml new file mode 100644 index 0000000..f5e8cb0 --- /dev/null +++ b/slides/intro/php7-anon-class.xml @@ -0,0 +1,24 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Anonymous Classes</blurb> +<example><![CDATA[ +<?php +return new class($controller) implements Page { + public function __construct($controller) { + /* ... */ + } + /* ... */ +}; + +class MyObject extends MyStuff { + public function getInterface() { + return new class implements MyInterface { + /* ... */ + }; + } +} +?>]]></example> + +</slide> diff --git a/slides/intro/php7-ast.xml b/slides/intro/php7-ast.xml new file mode 100644 index 0000000..3fd72f2 --- /dev/null +++ b/slides/intro/php7-ast.xml @@ -0,0 +1,38 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Abstract Syntax Tree!!</blurb> + +<example><![CDATA[ +<?php +echo substr("abc", [1,2]); +]]></example> + +<example><![CDATA[ +% phan -a test.php +AST_STMT_LIST @ 1 + 0: AST_STMT_LIST @ 2 + 0: AST_ECHO @ 2 + 0: AST_CALL @ 2 + 0: AST_NAME @ 2 + flags: NAME_NOT_FQ (1) + 0: "substr" + 1: AST_ARG_LIST @ 2 + 0: "abc" + 1: AST_ARRAY @ 2 + 0: AST_ARRAY_ELEM @ 2 + flags: 0 + 0: 1 + 1: null + 1: AST_ARRAY_ELEM @ 2 + flags: 0 + 0: 2 + 1: null +]]></example> +<example><![CDATA[ +% phan test.php +test.php:2 TypeError arg#2(start) is int[] but substr() takes int +]]></example> + +</slide> diff --git a/slides/intro/php7-bench-drupal8.xml b/slides/intro/php7-bench-drupal8.xml new file mode 100644 index 0000000..2d518f8 --- /dev/null +++ b/slides/intro/php7-bench-drupal8.xml @@ -0,0 +1,5 @@ +<slide> +<title>Performance: Drupal 8</title> + +<image filename="bench-drupal8.png"/> +</slide> diff --git a/slides/intro/php7-bench-magento2-dev.xml b/slides/intro/php7-bench-magento2-dev.xml new file mode 100644 index 0000000..6478866 --- /dev/null +++ b/slides/intro/php7-bench-magento2-dev.xml @@ -0,0 +1,5 @@ +<slide> +<title>Performance: Magento 2</title> + +<image filename="bench-magento2-dev.png"/> +</slide> diff --git a/slides/intro/php7-bench-mediawiki124.xml b/slides/intro/php7-bench-mediawiki124.xml new file mode 100644 index 0000000..31662a0 --- /dev/null +++ b/slides/intro/php7-bench-mediawiki124.xml @@ -0,0 +1,5 @@ +<slide> +<title>Performance: MediaWiki</title> + +<image filename="bench-mediawiki124.png"/> +</slide> diff --git a/slides/intro/php7-bench-phpbb313.xml b/slides/intro/php7-bench-phpbb313.xml new file mode 100644 index 0000000..ed272cd --- /dev/null +++ b/slides/intro/php7-bench-phpbb313.xml @@ -0,0 +1,5 @@ +<slide> +<title>Performance: phpBB</title> + +<image filename="bench-phpbb313.png"/> +</slide> diff --git a/slides/intro/php7-bench-wp411.xml b/slides/intro/php7-bench-wp411.xml new file mode 100644 index 0000000..9a20563 --- /dev/null +++ b/slides/intro/php7-bench-wp411.xml @@ -0,0 +1,5 @@ +<slide> +<title>Performance: WordPress 4.11</title> + +<image filename="bench-wp411.png"/> +</slide> diff --git a/slides/intro/php7-coalesce.xml b/slides/intro/php7-coalesce.xml new file mode 100644 index 0000000..e1108be --- /dev/null +++ b/slides/intro/php7-coalesce.xml @@ -0,0 +1,18 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Coalesce Operator</blurb> +<example><![CDATA[ +<?php +$a = NULL; +$b = 0; +$c = 2; + +echo $a ?? $b; // 0 +echo $c ?? $b; // 2 +echo $a ?? $b ?? $c; // 0 +echo $a ?? $x ?? $c; // 2 +?>]]></example> + +</slide> diff --git a/slides/intro/php7-csprng.xml b/slides/intro/php7-csprng.xml new file mode 100644 index 0000000..331e7dc --- /dev/null +++ b/slides/intro/php7-csprng.xml @@ -0,0 +1,16 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ CSPRNG</blurb> +<example result='1'><![CDATA[ +<?php +$int = random_int(-500, 500); +$bytes = random_bytes(10); + +var_dump( $int ); +var_dump( bin2hex($bytes) ); +?> +]]></example> + +</slide> diff --git a/slides/intro/php7-engine-improv.xml b/slides/intro/php7-engine-improv.xml new file mode 100644 index 0000000..e0f652a --- /dev/null +++ b/slides/intro/php7-engine-improv.xml @@ -0,0 +1,11 @@ +<slide> + +<image filename="php7trans-200.png" /> +<break/> +<blurb fontsize="1.1em" align="left">✔ engine improvements</blurb> +<list> +<bullet fontsize="1em">100%+ performance gain on most real-world applications</bullet> +<bullet fontsize="1em">Lower memory usage, sometimes drastically lower</bullet> +</list> + +</slide> diff --git a/slides/intro/php7-enterprise.xml b/slides/intro/php7-enterprise.xml new file mode 100644 index 0000000..310056e --- /dev/null +++ b/slides/intro/php7-enterprise.xml @@ -0,0 +1,19 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ ---Tie Advanced X1 Operator---<br/>Spaceship Operator → Enterprise Software</blurb> +<image filename="php-enterprise.jpg" align="right"/> +<example><![CDATA[ +<?php + +function cmp_php5($a, $b) { + return ($a < $b) ? -1 : (($a >$b) ? 1 : 0); +} + +function cmp_php7($a, $b) { + return $a <=> $b; +} +?>]]></example> + +</slide> diff --git a/slides/intro/php7-exception-hiearchy.xml b/slides/intro/php7-exception-hiearchy.xml new file mode 100644 index 0000000..af87601 --- /dev/null +++ b/slides/intro/php7-exception-hiearchy.xml @@ -0,0 +1,21 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>PHP 7 Exception Hierarchy</blurb> +<break lines="1"/> +<list> +<bullet>|ab5c5c|Throwable| + <list> + <bullet>|ab5c5c|Exception| implements Throwable</bullet> + <bullet>|ab5c5c|Error| implements Throwable + <list> + <bullet>|ab5c5c|TypeError| extends Error</bullet> + <bullet>|ab5c5c|ParseError| extends Error</bullet> + </list> + </bullet> + </list> +</bullet> +</list> + +</slide> diff --git a/slides/intro/php7-exception-hierachy.xml b/slides/intro/php7-exception-hierachy.xml new file mode 100644 index 0000000..6580b22 --- /dev/null +++ b/slides/intro/php7-exception-hierachy.xml @@ -0,0 +1,15 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb fontsize="2em" align="center">PHP 7 Exception Hierarchy</blurb> +<break lines="1"/> +<list fontsize="1.5em"> +<bullet fontsize="1.5em" type="none">|ab5c5c|Throwable|</bullet> +<bullet fontsize="1.25em" marginleft="2em" type="none">➥ |ab5c5c|Exception| implements Throwable</bullet> +<bullet fontsize="1.25em" marginleft="2em" type="none">➥ |ab5c5c|Error| implements Throwable</bullet> +<bullet fontsize="1em" marginleft="4em" type="none">➥ |ab5c5c|TypeError| extends Error</bullet> +<bullet fontsize="1em" marginleft="4em" type="none">➥ |ab5c5c|ParseError| extends Error</bullet> +</list> + +</slide> diff --git a/slides/intro/php7-fatal-exception.xml b/slides/intro/php7-fatal-exception.xml new file mode 100644 index 0000000..485bffd --- /dev/null +++ b/slides/intro/php7-fatal-exception.xml @@ -0,0 +1,32 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Exceptions on Fatals</blurb> +<example fontsize="1.1em" result='0' title=""><![CDATA[ +function call_method($obj) { + $obj->method(); +} +call_method(null); +]]></example> +<example><![CDATA[ +Fatal error: Uncaught Error: Call to a member function method() on null in file:2 +Stack trace: +#0 file(4): call_method(NULL) +#1 {main} + thrown in file on line 2 +]]></example> + +<example><![CDATA[ +<?php +try { + call_method(null); +} catch (Error $e) { + echo "Caught Exception: {$e->getMessage()}\n"; +} +]]></example> +<example><![CDATA[ +Caught Exception: Call to a member function method() on null +]]></example> + +</slide> diff --git a/slides/intro/php7-mem-drupal8.xml b/slides/intro/php7-mem-drupal8.xml new file mode 100644 index 0000000..4bc6f8c --- /dev/null +++ b/slides/intro/php7-mem-drupal8.xml @@ -0,0 +1,5 @@ +<slide> +<title>Memory: Drupal 8</title> + +<image filename="mem-drupal8.png"/> +</slide> diff --git a/slides/intro/php7-mem-wp411.xml b/slides/intro/php7-mem-wp411.xml new file mode 100644 index 0000000..31a83da --- /dev/null +++ b/slides/intro/php7-mem-wp411.xml @@ -0,0 +1,5 @@ +<slide> +<title>Memory: WordPress 4.11</title> + +<image filename="mem-wp411.png"/> +</slide> diff --git a/slides/intro/php7-opcache-composer.xml b/slides/intro/php7-opcache-composer.xml new file mode 100644 index 0000000..aa642a4 --- /dev/null +++ b/slides/intro/php7-opcache-composer.xml @@ -0,0 +1,32 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<example fontsize="1.1em" result='0' title="" type="ini"><![CDATA[ +; --enable-opcache-file +; php.ini +opcache.file_cache=/var/tmp + +; php-cli.ini +opcache.enable_cli=1 +opcache.file_cache=/var/tmp +opcache.file_cache_only=1 +]]></example> +<example fontsize="1em" result='0' title="" type="shell nohighlight"><![CDATA[ +$ time composer >/dev/null +real 0m0.040s +user 0m0.032s +sys 0m0.004s + +$ time composer >/dev/null +real 0m0.019s +user 0m0.016s +sys 0m0.000s + +$ time php -d opcache.enable=0 /usr/local/bin/composer >/dev/null +real 0m0.033s +user 0m0.032s +sys 0m0.000s +]]></example> + +</slide> diff --git a/slides/intro/php7-opcache-persist.xml b/slides/intro/php7-opcache-persist.xml new file mode 100644 index 0000000..fa1ba9d --- /dev/null +++ b/slides/intro/php7-opcache-persist.xml @@ -0,0 +1,8 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Persistent secondary file-based cache for OPCache</blurb> +<image filename="pcache.png" /> + +</slide> diff --git a/slides/intro/php7-opcache-tree.xml b/slides/intro/php7-opcache-tree.xml new file mode 100644 index 0000000..94494bd --- /dev/null +++ b/slides/intro/php7-opcache-tree.xml @@ -0,0 +1,130 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<example><![CDATA[ +/var/tmp +├── 7eeb6fe88104116c27c5650ddd83abf0 +│ └── usr +│ └── local +│ └── bin +│ └── composer.bin +└── 7eeb6fe88104116c27c5650ddd83abf0phar: + └── usr + └── local + └── bin + └── composer + ├── bin + │ └── composer.bin + ├── src + │ ├── bootstrap.php.bin + │ └── Composer + │ ├── Command + │ │ ├── AboutCommand.php.bin + │ │ ├── ArchiveCommand.php.bin + │ │ ├── ClearCacheCommand.php.bin + │ │ ├── Command.php.bin + │ │ ├── ConfigCommand.php.bin + │ │ ├── CreateProjectCommand.php.bin + │ │ ├── DependsCommand.php.bin + │ │ ├── DiagnoseCommand.php.bin + │ │ ├── DumpAutoloadCommand.php.bin + │ │ ├── GlobalCommand.php.bin + │ │ ├── Helper + │ │ │ └── DialogHelper.php.bin + │ │ ├── HomeCommand.php.bin + │ │ ├── InitCommand.php.bin + │ │ ├── InstallCommand.php.bin + │ │ ├── LicensesCommand.php.bin + │ │ ├── RemoveCommand.php.bin + │ │ ├── RequireCommand.php.bin + │ │ ├── RunScriptCommand.php.bin + │ │ ├── SearchCommand.php.bin + │ │ ├── SelfUpdateCommand.php.bin + │ │ ├── ShowCommand.php.bin + │ │ ├── StatusCommand.php.bin + │ │ ├── UpdateCommand.php.bin + │ │ └── ValidateCommand.php.bin + │ ├── Composer.php.bin + │ ├── Console + │ │ └── Application.php.bin + │ ├── Factory.php.bin + │ ├── IO + │ │ ├── BaseIO.php.bin + │ │ ├── ConsoleIO.php.bin + │ │ └── IOInterface.php.bin + │ ├── Package + │ │ ├── BasePackage.php.bin + │ │ └── PackageInterface.php.bin + │ ├── Script + │ │ └── ScriptEvents.php.bin + │ └── Util + │ └── ErrorHandler.php.bin + └── vendor + ├── autoload.php.bin + ├── composer + │ ├── autoload_classmap.php.bin + │ ├── autoload_namespaces.php.bin + │ ├── autoload_psr4.php.bin + │ ├── autoload_real.php.bin + │ └── ClassLoader.php.bin + └── symfony + └── console + └── Symfony + └── Component + └── Console + ├── Application.php.bin + ├── Command + │ ├── Command.php.bin + │ ├── HelpCommand.php.bin + │ └── ListCommand.php.bin + ├── Descriptor + │ ├── ApplicationDescription.php.bin + │ ├── DescriptorInterface.php.bin + │ ├── Descriptor.php.bin + │ ├── JsonDescriptor.php.bin + │ ├── MarkdownDescriptor.php.bin + │ ├── TextDescriptor.php.bin + │ └── XmlDescriptor.php.bin + ├── Formatter + │ ├── OutputFormatterInterface.php.bin + │ ├── OutputFormatter.php.bin + │ ├── OutputFormatterStyleInterface.php.bin + │ ├── OutputFormatterStyle.php.bin + │ └── OutputFormatterStyleStack.php.bin + ├── Helper + │ ├── DebugFormatterHelper.php.bin + │ ├── DescriptorHelper.php.bin + │ ├── DialogHelper.php.bin + │ ├── FormatterHelper.php.bin + │ ├── HelperInterface.php.bin + │ ├── Helper.php.bin + │ ├── HelperSet.php.bin + │ ├── InputAwareHelper.php.bin + │ ├── ProcessHelper.php.bin + │ ├── ProgressHelper.php.bin + │ ├── QuestionHelper.php.bin + │ ├── TableHelper.php.bin + │ ├── Table.php.bin + │ └── TableStyle.php.bin + ├── Input + │ ├── ArgvInput.php.bin + │ ├── ArrayInput.php.bin + │ ├── InputArgument.php.bin + │ ├── InputAwareInterface.php.bin + │ ├── InputDefinition.php.bin + │ ├── InputInterface.php.bin + │ ├── InputOption.php.bin + │ └── Input.php.bin + └── Output + ├── ConsoleOutputInterface.php.bin + ├── ConsoleOutput.php.bin + ├── NullOutput.php.bin + ├── OutputInterface.php.bin + ├── Output.php.bin + └── StreamOutput.php.bin + +32 directories, 87 files +]]></example> + +</slide> diff --git a/slides/intro/php7-perf-memory-size.xml b/slides/intro/php7-perf-memory-size.xml new file mode 100644 index 0000000..204b37b --- /dev/null +++ b/slides/intro/php7-perf-memory-size.xml @@ -0,0 +1,22 @@ +<slide> +<title>Performance: Memory Size</title> + +<list> +<bullet>zval size reduced from 24 to 16 bytes</bullet> +<bullet>Hashtable size reduced from 72 to 56 bytes</bullet> +<bullet>Hashtable bucket size reduced from 72 to 32 bytes</bullet> +<bullet>Immutable array optimization</bullet> +</list> +<example><![CDATA[ +<?php +$a = []; +for($i=0; $i < 100000;$i++) { + $a[] = ['abc','def','ghi','jkl','mno','pqr']; +} +echo memory_get_usage(true); + +// PHP 5.x 109M +// PHP 7.0 42M no opcache +// PHP 7.0 6M with opcache enabled +]]></example> +</slide> diff --git a/slides/intro/php7-perf-others.xml b/slides/intro/php7-perf-others.xml new file mode 100644 index 0000000..53cdd8c --- /dev/null +++ b/slides/intro/php7-perf-others.xml @@ -0,0 +1,16 @@ +<slide> +<title>Performance: Memory Size</title> + +<list> +<bullet>Much more cpu cache friendly</bullet> +<bullet>New memory allocator similar to jemalloc</bullet> +<bullet>Faster hashtable iteration API</bullet> +<bullet>Array duplication optimization</bullet> +<bullet>PCRE JIT enabled by default</bullet> +<bullet>Fast ZPP (ZendParseParameters) implementation</bullet> +<bullet>Faster stack-allocated zvals (instead of heap)</bullet> +<bullet>Optimized VM calling</bullet> +<bullet>Global register variables with gcc 4.8+</bullet> +<bullet>plus hundreds of micro-optimizations</bullet> +</list> +</slide> diff --git a/slides/intro/php7-perf-wp-inst.xml b/slides/intro/php7-perf-wp-inst.xml new file mode 100644 index 0000000..1dd7982 --- /dev/null +++ b/slides/intro/php7-perf-wp-inst.xml @@ -0,0 +1,7 @@ +<slide> +<title>Performance: Wordpress Instructions</title> + +<blurb>Time and number of machine instructions for 100 requests against Wordpress-3.6.0 front page</blurb> + +<image filename="wp-instructions.png"/> +</slide> diff --git a/slides/intro/php7-sizet.xml b/slides/intro/php7-sizet.xml new file mode 100644 index 0000000..7a16e6e --- /dev/null +++ b/slides/intro/php7-sizet.xml @@ -0,0 +1,15 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ 64-bit integer support on Windows</blurb> +<blurb>✔ Cleanup edge-case integer overflow/underflow</blurb> +<blurb>✔ Support for strings with length >= 2³¹ bytes in 64 bit builds.</blurb> +<blurb>✔ Parse error on invalid numeric literals</blurb> +<example><![CDATA[ +<?php +$mask = 0855; // Parse error: Invalid numeric literal +?> +]]></example> + +</slide> diff --git a/slides/intro/php7-spaceship.xml b/slides/intro/php7-spaceship.xml new file mode 100644 index 0000000..4f94022 --- /dev/null +++ b/slides/intro/php7-spaceship.xml @@ -0,0 +1,25 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Tie Advanced X1 Operator</blurb> +<image filename="tieadvancedx1.jpg" align="right"/> +<example><![CDATA[ +|=| Tie Fighter +k=k Tie Interceptor +<==> Tie Bomber +<=> Tie Advanced X1 ✔ +]]></example> +<example><![CDATA[ +<?php + +function cmp_php5($a, $b) { + return ($a < $b) ? -1 : (($a >$b) ? 1 : 0); +} + +function cmp_php7($a, $b) { + return $a <=> $b; +} +?>]]></example> + +</slide> diff --git a/slides/intro/php7-speedy-elephpant.xml b/slides/intro/php7-speedy-elephpant.xml new file mode 100644 index 0000000..cb28977 --- /dev/null +++ b/slides/intro/php7-speedy-elephpant.xml @@ -0,0 +1,5 @@ +<slide> + +<break lines="2"/> +<image align="center" filename="elephpant-php7-trans.png"/> +</slide> diff --git a/slides/intro/php7-types-coercive.xml b/slides/intro/php7-types-coercive.xml new file mode 100644 index 0000000..7c09b53 --- /dev/null +++ b/slides/intro/php7-types-coercive.xml @@ -0,0 +1,19 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Coercive Scalar Types</blurb> + +<example><![CDATA[ +function logmsg(string $msg, int $level, float $severity) { + var_dump($msg); // string(1) "1" + var_dump($level); // int(2) + var_dump($severity); // float(3) +} +logmsg(1, "2.5 bananas", 3); +]]></example> +<example><![CDATA[ +Notice: A non well formed numeric value encountered in file on line 2 +]]></example> + +</slide> diff --git a/slides/intro/php7-types-return.xml b/slides/intro/php7-types-return.xml new file mode 100644 index 0000000..27abdb3 --- /dev/null +++ b/slides/intro/php7-types-return.xml @@ -0,0 +1,21 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Return Types</blurb> +<example><![CDATA[ +function get_config(): array { + return 42; +} +get_config(); +]]></example> +<example><![CDATA[ +Fatal error: Uncaught TypeError: Return value of get_config() must be +of the type array, integer returned in file:2 +Stack trace: +#0 file(4): get_config() +#1 {main} + thrown in file on line 2 +]]></example> + +</slide> diff --git a/slides/intro/php7-types-strict.xml b/slides/intro/php7-types-strict.xml new file mode 100644 index 0000000..66646b1 --- /dev/null +++ b/slides/intro/php7-types-strict.xml @@ -0,0 +1,20 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Strict Scalar Types</blurb> +<example><![CDATA[ +declare(strict_types=1); +... +logmsg(1, "2.5", 3); +]]></example> +<example><![CDATA[ +Fatal error: Uncaught TypeError: Argument 1 passed to logmsg() must be of the +type string, integer given, called in file on line 7 and defined in file:3 +Stack trace: +#0 file(7): logmsg(1, '2.5', 3) +#1 {main} + thrown in file on line 2 +]]></example> + +</slide> diff --git a/slides/intro/php7-unicode.xml b/slides/intro/php7-unicode.xml new file mode 100644 index 0000000..3ed2852 --- /dev/null +++ b/slides/intro/php7-unicode.xml @@ -0,0 +1,14 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Unicode Codepoint Escape Syntax</blurb> +<example result='1'><![CDATA[ +<?php +echo "\u{202E}Right-to-left text"; + +echo "\u{1F602}"; +?> +]]></example> + +</slide> diff --git a/slides/intro/php7-uvs.xml b/slides/intro/php7-uvs.xml new file mode 100644 index 0000000..1d4a8ea --- /dev/null +++ b/slides/intro/php7-uvs.xml @@ -0,0 +1,49 @@ +<slide> +<image filename="php7trans-200.png" /> +<break/> + +<blurb>✔ Uniform variable syntax</blurb> + +<example result='0' title=""><![CDATA[ +<?php +// left-to-right +$this->$belongs_to['column'] +// vs. +$this->{$belongs_to['column']} + +// support missing combinations of operations +$foo()['bar']() +[$obj1, $obj2][0]->prop +getStr(){0} + +// support nested :: +$foo['bar']::$baz +$foo::$bar::$baz +$foo->bar()::baz() + +// support nested () +foo()() +$foo->bar()() +Foo::bar()() +$foo()() + +// support operations on arbitrary (...) expressions +(...)['foo'] +(...)->foo +(...)->foo() +(...)::$foo +(...)::foo() +(...)() + +// two more practical examples for the last point +(function() { ... })() +($obj->closure)() + +// support all operations on dereferencable scalars +// (not very useful) +"string"->toLower() +[$obj, 'method']() +'Foo'::$bar +]]></example> + +</slide> diff --git a/slides/intro/tieadvancedx1.jpg b/slides/intro/tieadvancedx1.jpg new file mode 100644 index 0000000..1414296 Binary files /dev/null and b/slides/intro/tieadvancedx1.jpg differ diff --git a/slides/intro/wp-instructions.png b/slides/intro/wp-instructions.png new file mode 100644 index 0000000..89158a3 Binary files /dev/null and b/slides/intro/wp-instructions.png differ diff --git a/templates/default/literal.ezt b/templates/default/literal.ezt new file mode 100644 index 0000000..a551e8d --- /dev/null +++ b/templates/default/literal.ezt @@ -0,0 +1,5 @@ +{use $node, $pres} +{foreach $node->childNodes as $child} +{raw $child->nodeValue} +{/foreach} +</h1>