[PRES] [presentations] master: Add slide on pipes

From: Date: Thu, 15 May 2025 08:12:59 +0000
Subject: [PRES] [presentations] master: Add slide on pipes
Groups: php.pres 
Request: Send a blank email to pres+get-2467@lists.php.net to get a copy of this message
Author: Derick Rethans (derickr) Date: 2025-05-15T09:01:28+01:00 Commit: https://github.com/php/presentations/commit/ccebf2af85c4c00a603ec9894b060b7415d59bf5 Raw diff: https://github.com/php/presentations/commit/ccebf2af85c4c00a603ec9894b060b7415d59bf5.diff Add slide on pipes Changed paths: A slides/internals/php85-pipes.xml M php-phpday25.xml M slides/internals/php85-closures-in-constant-expressions.xml Diff: diff --git a/php-phpday25.xml b/php-phpday25.xml index b8cfddca..3f0fc375 100644 --- a/php-phpday25.xml +++ b/php-phpday25.xml @@ -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> diff --git a/slides/internals/php85-closures-in-constant-expressions.xml b/slides/internals/php85-closures-in-constant-expressions.xml index f8bd4d00..d17b8287 100644 --- a/slides/internals/php85-closures-in-constant-expressions.xml +++ b/slides/internals/php85-closures-in-constant-expressions.xml @@ -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> diff --git a/slides/internals/php85-pipes.xml b/slides/internals/php85-pipes.xml new file mode 100644 index 00000000..f0a12821 --- /dev/null +++ b/slides/internals/php85-pipes.xml @@ -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>

« previous php.pres (#2467) next »