Hi,
Joshua Thompson schrieb:
Andi Gutmans wrote:
The following code shows a few things:
- local properties which can be used in self-contained functionality.
The storage is guaranteed to stay internal and will not clash with the
aggregating class.
Yes, it is a nice to have.
- methods are by default hidden to the aggregating class and bound to
the trait (as Marcus pointed out the method name would be mangled with
the trait's name)
Hm, ok. It is the pessimistic counterpart to my proposal. In general,
I'm much more optimistic and would prefer to teach developers to use
proper naming to avoid conflicts. But if there is no other way to go, it
is ok.
I was working on a detailed RFC of something along these lines. I didn't
include the local keyword, instead I went the route of stateful traits
and forced the definition of which scope in the class. I also tried to
keep the number of keywords to 1 (`trait`).
I will keep working on it, and hopefully post it tomorrow for review.
Looking forward to read it :)
Kind Regards
Stefan
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php