Re: [PHP-DEV] Pre proposal for "Class extension functions"

2018-09-26 Thread Sebastian Bergmann
On 9/25/18 10:48 PM, Sara Golemon wrote: > I've been back-burnering this for a few days and I'm with Stas. I > don't like this proposal because it adds complexity with relatively > little benefit. I only see problems (mostly due to added complexity) and no benefits. -1 from me. -- PHP Internals

Re: [PHP-DEV] Pre proposal for "Class extension functions"

2018-09-25 Thread Sara Golemon
On Tue, Sep 25, 2018 at 1:50 AM Stanislav Malyshev wrote: > > 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'); > > } > > I feel this is inviting trouble.

Re: [PHP-DEV] Pre proposal for "Class extension functions"

2018-09-25 Thread Christoph M. Becker
On 25.09.2018 at 08:50, Stanislav Malyshev wrote: >> 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'); >> } > > I think this wouldn't add much what we already

Re: [PHP-DEV] Pre proposal for "Class extension functions"

2018-09-24 Thread Stanislav Malyshev
Hi! > 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'); > } I feel this is inviting trouble. If you need additional functionality, why not extend the class? Or wr

Re: [PHP-DEV] Pre proposal for "Class extension functions"

2018-09-24 Thread Stanislav Malyshev
Hi! > 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'); > } I feel this is inviting trouble. If you need additional functionality, why not extend the class? Or wr

Re: [PHP-DEV] Pre proposal for "Class extension functions"

2018-09-24 Thread Stephen Reay
> On 24 Sep 2018, at 6:21 pm, Andrey O Gromov 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

Re: [PHP-DEV] Pre proposal for "Class extension functions"

2018-09-24 Thread Levi Morrison
On Mon, Sep 24, 2018 at 5:21 AM Andrey O Gromov 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

Re: [PHP-DEV] Pre proposal for "Class extension functions"

2018-09-24 Thread Sara Golemon
On Mon, Sep 24, 2018 at 6:21 AM Andrey O Gromov wrote: > > I want to do RFS proposal for new language concept - Class extension > functions. > Bring a little Javascript into PHP? Hrmm, maybe. I can see some value, though I'd offer a few thoughts: 1. Consider requiring that a class opt in to allow

[PHP-DEV] Pre proposal for "Class extension functions"

2018-09-24 Thread Andrey O Gromov
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/p