Skip to content

Commit c999c70

Browse files
authored
Typographic fixes. (#4909)
1 parent 2946c8a commit c999c70

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

language/operators/functional.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<title>Functional Operators</title>
44
<titleabbrev>Functional</titleabbrev>
55
<para>
6-
PHP 8.5 and later supports one operator that works directly on callables. The <literal>|></literal>
6+
PHP 8.5 and later supports one operator that works directly on callables. The <literal>|&gt;</literal>
77
operator, or “pipe,” accepts a single-parameter callable on the right and passes
88
the left-side value to it, evaluating to the callable's result. The callable
99
on the right may be any valid PHP callable: a <classname>Closure</classname>,
@@ -13,15 +13,15 @@
1313
<para>
1414
That means the following two lines are logically equivalent.
1515
<example>
16-
<title>Using <literal>|></literal></title>
16+
<title>Using <literal>|&gt;</literal></title>
1717
<programlisting role="php">
1818
<![CDATA[
1919
<?php
2020
$result = "Hello World" |> strlen(...);
21-
print $result . PHP_EOL;
21+
echo $result, PHP_EOL;
2222
2323
$result = strlen("Hello World");
24-
print $result . PHP_EOL;
24+
echo $result, PHP_EOL;
2525
?>
2626
]]>
2727
</programlisting>
@@ -38,7 +38,7 @@ print $result . PHP_EOL;
3838
For a single call that is not especially useful. It becomes useful when multiple calls are chained together.
3939
That is, the following two code fragments are logically equivalent:
4040
<example>
41-
<title>Chaining |> calls</title>
41+
<title>Chaining |&gt; calls</title>
4242
<programlisting role="php">
4343
<![CDATA[
4444
<?php
@@ -48,15 +48,15 @@ $result = "PHP Rocks"
4848
|> (fn($x) => array_map(strtoupper(...), $x))
4949
|> (fn($x) => array_filter($x, fn($v) => $v != 'O'))
5050
;
51-
print $result . PHP_EOL;
51+
echo $result, PHP_EOL;
5252
5353
$temp = "PHP Rocks";
5454
$temp = htmlentities($temp);
5555
$temp = str_split($temp);
5656
$temp = array_map(strtoupper(...), $temp);
5757
$temp = array_filter($temp, fn($v) => $v != 'O');
5858
$result = $temp;
59-
print $result . PHP_EOL;
59+
echo $result, PHP_EOL;
6060
?>
6161
]]>
6262
</programlisting>

0 commit comments

Comments
 (0)