On 23/03/2020 17:58, jan.h.boeh...@gmx.de wrote:
I have opened voting on
https://wiki.php.net/rfc/userspace_operator_overloading, which allows users
to overload operators in their own classes.

I am certainly not opposed to operator overloading, and would like to see it in the language.

However, I'll be voting no because of a couple of implementation points:

1. I feel like the choice of NULL as the return type for not implemented is far from ideal, especially for 8.0 which provides for union type hints.

2. The error handling behaviour is too timid. If operator overloading is to become a first-class feature, error handling should reflect as such and any attempt to use objects without the appropriate handlers being installed really should result in an error being thrown just as it would be if an undefined method was called.

Mark Randall

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to