Repository navigation
Document the pipe operator. - #4890
Merged
Merged
Conversation
Crell
force-pushed
the
pipe-operator
branch
2 times, most recently
from
October 2, 2025 21:13
04afff0 to
fb5dbf7
Compare
Fan2Shrek
approved these changes
Oct 3, 2025
PhilDaiguille
approved these changes
Oct 3, 2025
TimWolla
requested changes
Oct 4, 2025
TimWolla
left a comment
Member
There was a problem hiding this comment.
Needs to be added to the precedence list: https://www.php.net/manual/en/language.operators.precedence.php
Also not particularly happy with calling this “Functional Operators”.
| <title>Functional Operators</title> | ||
| <titleabbrev>Functional</titleabbrev> | ||
| <para> | ||
| PHP 8.5 and later supports one operator that works directly on callables. The <literal>|></literal> |
Member
There was a problem hiding this comment.
Suggested change
| PHP 8.5 and later supports one operator that works directly on callables. The <literal>|></literal> | |
| PHP 8.5 and later supports one operator that works directly on callables. The <literal>|></literal> |
Bare > in XML is fugly (same below).
| print $result . PHP_EOL; | ||
|
|
||
| $result = strlen("Hello World"); | ||
| print $result . PHP_EOL; |
Member
There was a problem hiding this comment.
Prefer echo and , PHP_EOL (with the comma).
Contributor
Author
|
I wasn't sold on "functional operator" either, but in Discord we didn't think of anything better. I'm open to suggestions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most of the text and examples here are pulled straight from the RFC.