Re: [RFC] User Defined Operator Overloads (v0.6)
| From: | Jordan LeDoux | Date: | Fri, 17 Dec 2021 19:10:40 +0000 |
| Subject: | Re: [RFC] User Defined Operator Overloads (v0.6) | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116677@lists.php.net to get a copy of this message | ||
On Fri, Dec 17, 2021 at 10:36 AM Stanislav Malyshev <smalyshev@gmail.com>
wrote:
> And that's one of the reasons I feel so uneasy with this. When reading
> this code: $foo * $bar - how do I know which of the ways you took and
> where should I look for the code that is responsible for it? When I see
> $foo->times($bar) it's clear who's in charge and where I find the code.
> Terse code is nice but not at the expense of making it write-only.
>
I think that something on php.net that focuses on best practices and things
to watch out for could go a long way towards this. In general, when people
search for information on how to do something, if that information isn't in
the PHP manual, they'll end up getting a random answer from stackoverflow.
I'd definitely be willing to put in some work to help on such documentation.
I very much expect that this feature will result in community developed
standards, such as a PSR.
Jordan