Hi,

After reading all the thread:

I'm +1 for `: static` as proposed by this RFC.

I'm also +1 for `: $this`, preferably also in PHP 8.0, but that could
be a separate RFC:
- I like the idea to check it at compile time (like `: void`), i.e.
that all the return points of the method be syntactically `return
$this;` (maybe also allow `return $this->otherMethod(/*...*/);` where
the forwarded method is itself declared `: $this`).
- Regarding covariance, `$this` should probably be treated like a
"subtype" of `static`.
- I don't like the idea of making an implicit `return $this;` in
addition to the check.

I'm -1 for `: fluent` or `fluent function` as an alternative to `: $this`.

I'm -0.5 for `: new` / `: clone`.

About "what comes out is the same type as what goes in", I would wait
for generics.

-- 
Guilliam Xavier

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

Reply via email to