On Mon, Sep 24, 2018 at 5:21 AM Andrey O Gromov <agro...@alfabank.ru> wrote:
>
> Hello.
>
> I want to do RFS proposal for new language concept - Class extension
> functions.
>
> Syntax will looks like:
>
> function DateTime->localTime() {
>     return $this->format('H:i');
> }
>
> $date = new DateTime();
>
> echo $date->localTime();
>
>
> Realisation draft already written (
> https://github.com/rjhdby/php-src/commit/a54d7d3f8504d2e15908bb0e44de0b2f87683872
> )
>
> It is interesting or not?

Definitely interesting. The patch doesn't seem to handle inheritance
conflicts, though. For instance, if I add something to a base class
that ends up conflicting with a sub-class that is already defined. It
may not need to handle it in any particular way, but should be
specified at least.

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

Reply via email to