mirror of
https://github.com/php/presentations.git
synced 2026-03-23 23:22:22 +01:00
Add slide on pipes
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
27
slides/internals/php85-pipes.xml
Normal file
27
slides/internals/php85-pipes.xml
Normal 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>
|
||||
Reference in New Issue
Block a user