On 20.09.2024 at 15:00, Gina P. Banyard wrote:

> This leads to a rather insane situation where the engine does not assume + is 
> always commutative but does so for *, something which makes no sense as 
> multiplication or product operations are (in the grand scheme of mathematics) 
> rarely commutative.

Gosh, I had completely forgotten about ZEND_TRY_BINARY_OBJECT_OPERATION.
 So I withdraw my statement about the only reasonable way to implement
operator overloading in PHP[1], and state that there is no reasonable
way to implement operator overloading in PHP at all (excluding
comparison and equality operations), since apparently, we cannot even
get the *only two* internal bundled classes to properly handle this.
Cf. <https://3v4l.org/gksqI/rfc#vgit.master> and
<https://3v4l.org/o5Uhh/rfc#vgit.master>.

[1] <https://externals.io/message/125550#125621>

Christoph

Reply via email to