com presentations: Tweaks: expotec.html slides/intro/php71 _2016.xml
[email protected] (Rasmus Lerdorf) Mon, 22 Aug 2016 21:19:06 +0000
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Commit: 90a85c9d207002e65f6e4e17d87b00cb3567b0bc Author: Rasmus Lerdorf <[email protected]> Mon, 22 Aug 2016 14:19:06 -0700 Parents: e22e8dc8744e5594fc5cd1abbc8249b391149a4b Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=90a85c9d207002e65f6e4e17d87b00cb3567b0bc Log: Tweaks Changed paths: M expotec.html M slides/intro/php71_2016.xml Diff: diff --git a/expotec.html b/expotec.html index 694fe01..ac28182 100644 --- a/expotec.html +++ b/expotec.html @@ -561,8 +561,8 @@ $bytes = random_bytes(10); var_dump( $int ); var_dump( bin2hex($bytes) );</code></pre> - <pre class="output" style="font-size:1.2em;">int(-427) -string(20) "64699c4e73a7384777b7" + <pre class="output" style="font-size:1.2em;">int(-500) +string(20) "2c036aad5b026c33fe7f" </pre> </section> </section> <section> <section id="php7perfdetail"> @@ -1365,10 +1365,17 @@ pushbot: clear </section> <section id="php71_void"> <p class="p" style="font-size:1.1em;text-align:left;">✔ void return type</p> - <pre><code class="ini" data-trim style="font-size:1.1em;">function should_return_nothing(): void { + <pre><code data-trim style="font-size:1.1em;">function should_return_nothing(): void { return 1; // Fatal error: A void function must not return a value }</code></pre> </section> +<section id="php71_nullable"> + <p class="p" style="font-size:1.1em;text-align:left;">✔ Nullable types</p> + <pre><code data-trim style="font-size:1.1em;">function answer(int $a, ?int $b): ?int { + if($a > $b) return $a; + else return null; +}</code></pre> + </section> <section id="php71iterable"> <p class="p" style="font-size:1.1em;text-align:left;">✔ Iterable pseudo-type</p> <pre><code data-trim style="font-size:1.1em;">function foo(iterable $iterable) { @@ -1413,6 +1420,7 @@ Notice: A non well formed numeric string encountered in example.php on line 2</c <li style="font-size: 0.8em;margin-left: -1em;">rand() and srand() are now aliased to mt_rand() and mt_srand()</li> <li style="font-size: 0.8em;margin-left: -1em;">Calling a function with too few args is now an Error instead of a Warning</li> <li style="font-size: 0.8em;margin-left: -1em;">Dropped support for sslv2 streams</li> + <li style="font-size: 0.8em;margin-left: -1em;">Dropped support for mcrypt</li> </ul> </section> </section> <section> diff --git a/slides/intro/php71_2016.xml b/slides/intro/php71_2016.xml index 76e72a1..c9470c6 100644 --- a/slides/intro/php71_2016.xml +++ b/slides/intro/php71_2016.xml @@ -5,13 +5,24 @@ <break lines="1" section="php71_void"/> <blurb fontsize="1.1em" align="left">✔ void return type</blurb> -<example fontsize="1.1em" result='0' title="" type="ini"><![CDATA[ +<example fontsize="1.1em" result='0' title="" type=""><![CDATA[ <?php function should_return_nothing(): void { return 1; // Fatal error: A void function must not return a value } ]]></example> +<break lines="1" section="php71_nullable"/> +<blurb fontsize="1.1em" align="left">✔ Nullable types</blurb> + +<example fontsize="1.1em" result='0' title="" type=""><![CDATA[ +<?php +function answer(int $a, ?int $b): ?int { + if($a > $b) return $a; + else return null; +} +]]></example> + <break lines="1" section="php71iterable"/> <blurb fontsize="1.1em" align="left">✔ Iterable pseudo-type</blurb> @@ -76,6 +87,7 @@ class Token { <bullet marginleft="-1em" fontsize="0.8em">rand() and srand() are now aliased to mt_rand() and mt_srand()</bullet> <bullet marginleft="-1em" fontsize="0.8em">Calling a function with too few args is now an Error instead of a Warning</bullet> <bullet marginleft="-1em" fontsize="0.8em">Dropped support for sslv2 streams</bullet> +<bullet marginleft="-1em" fontsize="0.8em">Dropped support for mcrypt</bullet> </list> </slide>