Add slide on pipes

This commit is contained in:
Derick Rethans
2025-05-15 09:01:28 +01:00
parent fc18b7c7ef
commit ccebf2af85
3 changed files with 32 additions and 2 deletions

View File

@@ -37,6 +37,9 @@ https://wiki.php.net/rfc/new_without_parentheses
https://wiki.php.net/rfc/closures_in_const_expr
<slide>slides/internals/php85-closures-in-constant-expressions.xml</slide>
https://wiki.php.net/rfc/pipe-operator-v3
<slide>slides/internals/php85-pipes.xml</slide>
https://wiki.php.net/rfc/fcc_in_const_expr
<slide>slides/internals/php85-fcc-in-constant-expressions.xml</slide>
@@ -76,8 +79,10 @@ https://wiki.php.net/rfc/new_rounding_modes_to_round_function
<slide>slides/internals/php84-round-modes.xml</slide>
-->
<!--
https://wiki.php.net/rfc/bcrypt_cost_2023
<slide>slides/internals/php84-bcrypt-cost.xml</slide>
-->
https://wiki.php.net/rfc/grapheme_str_split
<slide>slides/internals/php84-grapheme-str-split.xml</slide>

View File

@@ -20,12 +20,10 @@ function slugger(
var_dump(slugger('Hello, World!')); // string(11) "hello-world"
?>]]></example>
<div effect="fade-in">
<list>
<bullet>They must be %static%</bullet>
<bullet>They may not include variables from the surrounding scope<br/>no:
%use($foo)%, nor: short closures (%fn … =>%)</bullet>
</list>
</div>
</slide>

View File

@@ -0,0 +1,27 @@
<slide>
<title>PHP 8.5: Pipe Operator</title>
<example><![CDATA[<?php
function slugger(string $input)
{
return $input
|> \strtolower(...)
|> fn($x) => \preg_replace('/[^a-z]/', '-', $x)
|> fn($x) => \trim($value, '-')
|> fn($x) => \preg_replace('/-+/', '-', $x);
}
var_dump(slugger('Hello, World!')); // string(11) "hello-world"
?>]]></example>
<list>
<bullet>Still under consideration (but currently passing)</bullet>
</list>
</slide>