com presentations: Regenerate with new result block: phpnw17.html slides/intro/dce.xml slides/intro/php72_2018.xm l
[email protected] (Rasmus Lerdorf) Sat, 30 Sep 2017 11:36:52 +0000
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Commit: 3de6a6768deb31c6cb47d069c227713d06dab38f Author: Rasmus Lerdorf <[email protected]> Sat, 30 Sep 2017 12:36:52 +0100 Parents: 06b8f7469a8c9a984806238393b2338711922cc7 Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=3de6a6768deb31c6cb47d069c227713d06dab38f Log: Regenerate with new result block Changed paths: M phpnw17.html M slides/intro/dce.xml M slides/intro/php72_2018.xml
diff_3de6a6768deb31c6cb47d069c227713d06dab38f.txt
(text/plain, 15.7 KB)
diff --git a/phpnw17.html b/phpnw17.html
index 9017081..5618e80 100644
--- a/phpnw17.html
+++ b/phpnw17.html
@@ -55,6 +55,17 @@
line-height: 125%;
-webkit-text-size-adjust: none;
}
+
+ .reveal code.result {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #ddd;
+ color: #000;
+ line-height: 125%;
+ -webkit-text-size-adjust: none;
+ }
+
/* Left-align h3 and h4 if they are p elements */
h3.p {
text-align: left;
@@ -399,7 +410,8 @@ class Wider extends Orig {
public function fn($arg) { }
}</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">In PHP 7.1 you would get:</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:0.8em;" >Warning: Declaration of Wider::fn($arg) should be compatible with Orig::fn(array $arg)</code></pre>
+ <pre><code class="result nohighlight" data-trim style="font-size:1em;" >Warning: Declaration of Wider::fn($arg) should be
+ compatible with Orig::fn(array $arg)</code></pre>
</section>
<section id="php72_commas">
<p class="p" style="font-size:1.1em;text-align:left;">Allow trailing commas everywhere</p>
@@ -441,13 +453,13 @@ class Foo implements
return json_decode('{}');
}
fn("not an object");</code></pre>
- <pre><code class="shell nohighlight" data-trim style="font-size:0.9em;" >Warning: Uncaught TypeError: Argument 1 passed to fn() must be an object,
+ <pre><code class="result nohighlight" data-trim style="font-size:0.9em;" >Warning: Uncaught TypeError: Argument 1 passed to fn() must be an object,
string given, called in php shell code on line 1 and defined in ...</code></pre>
</section>
<section id="php72_unqouted">
<p class="p" style="font-size:1.1em;text-align:left;">Deprecate unquoted strings</p>
<pre><code data-trim style="font-size:1.05em;" >echo HELLO;</code></pre>
- <pre><code class="shell nohighlight" data-trim style="font-size:0.9em;" >Warning: Use of undefined constant HELLO - assumed 'HELLO' (this will throw
+ <pre><code class="result nohighlight" data-trim style="font-size:0.9em;" >Warning: Use of undefined constant HELLO - assumed 'HELLO' (this will throw
an Error in a future version of PHP) in php shell code on line 1</code></pre>
</section>
<section id="php72_mail">
@@ -469,7 +481,7 @@ mail($to, $subject, $message, $headers);</code></pre>
'threads' => 2
];
echo password_hash("rasmuslerdorf", PASSWORD_ARGON2I, $options);</code></pre>
- <pre><code class="shell nohighlight" data-trim style="font-size:0.9em;" >$argon2i$v=19$m=2048,t=10,p=2$akUuWkoxRDlMSi5TVGhYLg$j0D1Cl4aR8UMHOGGx5JtZ1BmCApr8RmOJA9qFWm5mz8</code></pre>
+ <pre><code class="result nohighlight" data-trim style="font-size:0.9em;" >$argon2i$v=19$m=2048,t=10,p=2$akUuWkoxRDlMSi5TVGhYLg$j0D1Cl4aR8UMHOGGx5JtZ1BmCApr8RmOJA9qFWm5mz8</code></pre>
</section>
<section id="php72_sodium">
<p class="p" style="font-size:1.1em;text-align:left;">Add Sodium Crypto Library</p>
@@ -503,20 +515,20 @@ if ($original_msg === false) {
<section id="dce">
<p class="p" style="font-size:2em;text-align:center;">Dead Code Elimination (DCE)</p>
<p class="p" style="font-size:1.5em;text-align:center;">Escape Analysis</p>
- <p class="p" style="font-size:1.4em;text-align:center;">Sparse conditional constant propagation</p>
+ <p class="p" style="font-size:1.4em;text-align:center;">Sparse Conditional Constant Propagation</p>
</section>
<section id="dce0">
- <pre><code class="shell nohighlight" data-trim style="font-size:0.9em;" >php -d opcache.optimization_level=-1 -d opcache.opt_debug_level=0x20000 script</code></pre>
+ <pre><code class="result nohighlight" data-trim style="font-size:0.9em;" >php -d opcache.optimization_level=-1 -d opcache.opt_debug_level=0x20000 script</code></pre>
<pre><code data-trim style="font-size:1.05em;" >function fn() {
$a = 1;
return 0;
}</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">PHP 7.1</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:1em;" >fn: (lines=2, args=0, vars=1, tmps=0)
+ <pre><code class="result nohighlight" data-trim style="font-size:1em;" >fn: (lines=2, args=0, vars=1, tmps=0)
L0: ASSIGN CV0($a) int(1)
L1: RETURN int(0)</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">PHP 7.2</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:1em;" >fn: (lines=1, args=0, vars=0, tmps=0)
+ <pre><code class="result nohighlight" data-trim style="font-size:1em;" >fn: (lines=1, args=0, vars=0, tmps=0)
L0: RETURN int(0)</code></pre>
</section>
<section id="dce1">
@@ -525,7 +537,7 @@ L0: RETURN int(0)</code></pre>
$x = 0;
return $x;
}</code></pre>
- <pre><code class="shell nohighlight" data-trim style="font-size:1em;" >PHP 7.1 PHP 7.2
+ <pre><code class="result nohighlight" data-trim style="font-size:1em;" >PHP 7.1 PHP 7.2
foo: (lines=10, args=4, vars=5, tmps=3) foo: (lines=5, args=4, vars=4, tmps=3)
L0: CV0($s1) = RECV 1 L0: CV0($s1) = RECV 1
L1: CV1($s2) = RECV 2 L1: CV1($s2) = RECV 2
@@ -545,7 +557,7 @@ L9: RETURN CV4($x)</code></pre>
return $a;
}</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">PHP 7.2</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:1em;" >foo: (lines=3, args=1, vars=1, tmps=1)
+ <pre><code class="result nohighlight" data-trim style="font-size:1em;" >foo: (lines=3, args=1, vars=1, tmps=1)
L0: CV0($a) = RECV 1
L1: ASSIGN_ADD CV0($a) int(3)
L2: RETURN CV0($a)</code></pre>
@@ -558,7 +570,7 @@ L2: RETURN CV0($a)</code></pre>
$a = $y;
return $a;
}</code></pre>
- <pre><code class="shell nohighlight" data-trim style="font-size:1em;" >PHP 7.2 PHP 7.3
+ <pre><code class="result nohighlight" data-trim style="font-size:1em;" >PHP 7.2 PHP 7.3
foo: (lines=7, args=2, vars=3, tmps=1) foo: (lines=4, args=2, vars=3, tmps=0)
L0: CV0($x) = RECV 1 L0: CV0($x) = RECV 1
L1: CV1($y) = RECV 2 L1: CV1($y) = RECV 2
@@ -576,7 +588,7 @@ function foo(int $x) {
return $x;
}</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">PHP 7.3</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=2, args=1, vars=1, tmps=0)
+ <pre><code class="result nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=2, args=1, vars=1, tmps=0)
L0: CV0($x) = RECV 1
L1: RETURN CV0($x)</code></pre>
</section>
@@ -590,7 +602,7 @@ function foo(int $x) {
return $x;
}</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">PHP 7.3</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=7, args=1, vars=2, tmps=1)
+ <pre><code class="result nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=7, args=1, vars=2, tmps=1)
L0: CV0($x) = RECV 1
L1: V2 = NEW 0 string("A")
L2: DO_FCALL
@@ -607,10 +619,10 @@ L6: RETURN CV0($x)</code></pre>
return $a;
}</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">PHP 7.2</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=1, args=0, vars=0, tmps=1)
+ <pre><code class="result nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=1, args=0, vars=0, tmps=1)
L0: RETURN int(4)</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">PHP 7.3</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=1, args=0, vars=0, tmps=0)
+ <pre><code class="result nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=1, args=0, vars=0, tmps=0)
L0: RETURN int(4)</code></pre>
</section>
<section id="dce7">
@@ -623,7 +635,7 @@ L0: RETURN int(4)</code></pre>
return $a[0];
}</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">PHP 7.3</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=2, args=1, vars=1, tmps=0)
+ <pre><code class="result nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=2, args=1, vars=1, tmps=0)
L0: CV0($x) = RECV 1
L1: RETURN int(0)</code></pre>
</section>
@@ -643,7 +655,7 @@ L1: RETURN int(0)</code></pre>
return $o->foo;
}</code></pre>
<p class="p" style="font-size:1.1em;text-align:left;">PHP 7.3</p>
- <pre><code class="shell nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=2, args=0, vars=0, tmps=0)
+ <pre><code class="result nohighlight" data-trim style="font-size:1.05em;" >foo: (lines=2, args=0, vars=0, tmps=0)
L0: ECHO int(1)
L1: RETURN int(4)</code></pre>
</section> </section>
diff --git a/slides/intro/dce.xml b/slides/intro/dce.xml
index cd23f8d..58f677a 100644
--- a/slides/intro/dce.xml
+++ b/slides/intro/dce.xml
@@ -2,11 +2,11 @@
<blurb fontsize="2em" align="center">Dead Code Elimination (DCE)</blurb>
<blurb fontsize="1.5em" align="center">Escape Analysis</blurb>
-<blurb fontsize="1.4em" align="center">Sparse conditional constant propagation</blurb>
+<blurb fontsize="1.4em" align="center">Sparse Conditional Constant Propagation</blurb>
<break lines="1" section="dce0"/>
-<example fontsize="0.9em" result='0' title="" type="shell nohighlight"><![CDATA[
+<example fontsize="0.9em" result='0' title="" type="result nohighlight"><![CDATA[
php -d opcache.optimization_level=-1 -d opcache.opt_debug_level=0x20000 script
]]></example>
@@ -19,14 +19,14 @@ function fn() {
]]></example>
<blurb fontsize="1.1em" align="left">PHP 7.1</blurb>
-<example fontsize="1em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
fn: (lines=2, args=0, vars=1, tmps=0)
L0: ASSIGN CV0($a) int(1)
L1: RETURN int(0)
]]></example>
<blurb fontsize="1.1em" align="left">PHP 7.2</blurb>
-<example fontsize="1em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
fn: (lines=1, args=0, vars=0, tmps=0)
L0: RETURN int(0)
]]></example>
@@ -41,7 +41,7 @@ function foo(string $s1, string $s2, string $s3, string $s4) {
}
]]></example>
-<example fontsize="1em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
PHP 7.1 PHP 7.2
foo: (lines=10, args=4, vars=5, tmps=3) foo: (lines=5, args=4, vars=4, tmps=3)
L0: CV0($s1) = RECV 1 L0: CV0($s1) = RECV 1
@@ -66,7 +66,7 @@ function foo($a) {
}
]]></example>
<blurb fontsize="1.1em" align="left">PHP 7.2</blurb>
-<example fontsize="1em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
foo: (lines=3, args=1, vars=1, tmps=1)
L0: CV0($a) = RECV 1
L1: ASSIGN_ADD CV0($a) int(3)
@@ -85,7 +85,7 @@ function foo(int $x, int $y) {
}
]]></example>
-<example fontsize="1em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
PHP 7.2 PHP 7.3
foo: (lines=7, args=2, vars=3, tmps=1) foo: (lines=4, args=2, vars=3, tmps=0)
L0: CV0($x) = RECV 1 L0: CV0($x) = RECV 1
@@ -109,7 +109,7 @@ function foo(int $x) {
]]></example>
<blurb fontsize="1.1em" align="left">PHP 7.3</blurb>
-<example fontsize="1.05em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1.05em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
foo: (lines=2, args=1, vars=1, tmps=0)
L0: CV0($x) = RECV 1
L1: RETURN CV0($x)
@@ -129,7 +129,7 @@ function foo(int $x) {
]]></example>
<blurb fontsize="1.1em" align="left">PHP 7.3</blurb>
-<example fontsize="1.05em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1.05em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
foo: (lines=7, args=1, vars=2, tmps=1)
L0: CV0($x) = RECV 1
L1: V2 = NEW 0 string("A")
@@ -153,13 +153,13 @@ function foo() {
]]></example>
<blurb fontsize="1.1em" align="left">PHP 7.2</blurb>
-<example fontsize="1.05em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1.05em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
foo: (lines=1, args=0, vars=0, tmps=1)
L0: RETURN int(4)
]]></example>
<blurb fontsize="1.1em" align="left">PHP 7.3</blurb>
-<example fontsize="1.05em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1.05em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
foo: (lines=1, args=0, vars=0, tmps=0)
L0: RETURN int(4)
]]></example>
@@ -178,7 +178,7 @@ function foo(int $x) {
]]></example>
<blurb fontsize="1.1em" align="left">PHP 7.3</blurb>
-<example fontsize="1.05em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1.05em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
foo: (lines=2, args=1, vars=1, tmps=0)
L0: CV0($x) = RECV 1
L1: RETURN int(0)
@@ -205,7 +205,7 @@ function foo() {
]]></example>
<blurb fontsize="1.1em" align="left">PHP 7.3</blurb>
-<example fontsize="1.05em" hide="0" result="0" title="" type="shell nohighlight"><![CDATA[
+<example fontsize="1.05em" hide="0" result="0" title="" type="result nohighlight"><![CDATA[
foo: (lines=2, args=0, vars=0, tmps=0)
L0: ECHO int(1)
L1: RETURN int(4)
diff --git a/slides/intro/php72_2018.xml b/slides/intro/php72_2018.xml
index 7f2012b..583953e 100644
--- a/slides/intro/php72_2018.xml
+++ b/slides/intro/php72_2018.xml
@@ -18,8 +18,9 @@ class Wider extends Orig {
}
]]></example>
<blurb fontsize="1.1em" align="left">In PHP 7.1 you would get:</blurb>
-<example fontsize="0.8em" result='0' title="" type="shell nohighlight"><![CDATA[
-Warning: Declaration of Wider::fn($arg) should be compatible with Orig::fn(array $arg)
+<example fontsize="1em" result='0' title="" type="result nohighlight"><![CDATA[
+Warning: Declaration of Wider::fn($arg) should be
+ compatible with Orig::fn(array $arg)
]]></example>
<break lines="1" section="php72_commas"/>
@@ -71,7 +72,7 @@ function fn(object $obj): object {
fn("not an object");
]]></example>
-<example fontsize="0.9em" result='0' title="" type="shell nohighlight"><![CDATA[
+<example fontsize="0.9em" result='0' title="" type="result nohighlight"><![CDATA[
Warning: Uncaught TypeError: Argument 1 passed to fn() must be an object,
string given, called in php shell code on line 1 and defined in ...
]]></example>
@@ -84,7 +85,7 @@ Warning: Uncaught TypeError: Argument 1 passed to fn() must be an object,
<?php
echo HELLO;
]]></example>
-<example fontsize="0.9em" result='0' title="" type="shell nohighlight"><![CDATA[
+<example fontsize="0.9em" result='0' title="" type="result nohighlight"><![CDATA[
Warning: Use of undefined constant HELLO - assumed 'HELLO' (this will throw
an Error in a future version of PHP) in php shell code on line 1
]]></example>
@@ -113,7 +114,7 @@ $options = [
];
echo password_hash("rasmuslerdorf", PASSWORD_ARGON2I, $options);
]]></example>
-<example fontsize="0.9em" result='0' title="" type="shell nohighlight"><![CDATA[
+<example fontsize="0.9em" result='0' title="" type="result nohighlight"><![CDATA[
$argon2i$v=19$m=2048,t=10,p=2$akUuWkoxRDlMSi5TVGhYLg$j0D1Cl4aR8UMHOGGx5JtZ1BmCApr8RmOJA9qFWm5mz8
]]></example>