On 18/01/2022 20:55, Jordan LeDoux wrote:
In this situation, the return value of the trait requires that $this implements the NumberInterface, however there is no way for the trait itself to enforce this.
Fair enough, that's a reasonable use case, thank you. I could quibble and say that "self" or "static" would probably work in that particular example, but I suspect that would just lead to an unproductive spiral of example and counter-example.
I'm not yet convinced that this use case is frequent enough to pass the high bar of adding a new language feature, but it at least reassures me that this isn't just control for control's sake.
Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php