Skip to content

Document the pipe operator. - #4890

Merged
Crell merged 1 commit into
php:masterfrom
Crell:pipe-operator
Oct 6, 2025
Merged

Crell merged 1 commit into
php:masterfrom
Crell:pipe-operator

Conversation

@Crell

@Crell Crell commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Most of the text and examples here are pulled straight from the RFC.

@Crell
Crell force-pushed the pipe-operator branch 2 times, most recently from 04afff0 to fb5dbf7 Compare October 2, 2025 21:13

@TimWolla TimWolla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>|&gt;</literal>

Bare > in XML is fugly (same below).

print $result . PHP_EOL;

$result = strlen("Hello World");
print $result . PHP_EOL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer echo and , PHP_EOL (with the comma).

@TimWolla
TimWolla requested a review from Girgias October 4, 2025 13:46
@Crell

Crell commented Oct 4, 2025

Copy link
Copy Markdown
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.

@Crell
Crell merged commit 2946c8a into php:master Oct 6, 2025
@Crell
Crell deleted the pipe-operator branch October 6, 2025 16:46
Crell added a commit to Crell/doc-en that referenced this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants