Re: [PHP-DEV] function overloading

2016-11-21 Thread Stanislav Malyshev
Hi! > a typical use case would be > > class EventHandler { > public function handle(ProductCreated $event) { > ... > } > public function handle(ProductNameChanged $event) { > ... > } > } > > vs what's currently being done: > > class EventHandler { > public fu

Re: [PHP-DEV] function overloading

2016-11-21 Thread Stanislav Malyshev
Hi! On 11/15/16 8:13 AM, Dominic Grostate wrote: > I think this may have been discussed before, but I was largely dismissed > because no one though it would be possible to implement. > > However assuming it is possible, what is the general feeling towards > function overloading, as seen in C# and

Re: [PHP-DEV] function overloading

2016-11-17 Thread Rowan Collins
On 16/11/2016 09:32, Quim Calpe wrote: class EventHandler { public function handle(Event $event) { if ($event instanceof ProductCreated) { ... } elseif ($event instanceof ProductNameChanged) { ... } } } I don't see much wrong with this; th

Re: [PHP-DEV] function overloading

2016-11-16 Thread Dominic Grostate
Mmhmm, and yet nowhere in my question did I mention performance, although it needs to be consider, that wasn't what I was probing for. I was seeing if it was worth my time producing a prototype and it turns out given the objections to the feature itself that it isn't. On 16 Nov 2016 9:40 am, "Joe

Re: [PHP-DEV] function overloading

2016-11-16 Thread Joe Watkins
Morning, You started with an assumption, and ended by asserting that your assumption was true. An implementation of overloading that somehow circumvents the obvious performance impact, and compatibility problems is not easily conceivable, at all. Cheers Joe On Tue, Nov 15, 2016 at 4:13 PM, Domi

Re: [PHP-DEV] function overloading

2016-11-16 Thread Quim Calpe
On Tue, Nov 15, 2016 at 10:33 PM, Alice Wonder wrote: > On 11/15/2016 08:13 AM, Dominic Grostate wrote: > >> I think this may have been discussed before, but I was largely dismissed >> because no one though it would be possible to implement. >> >> However assuming it is possible, what is the gene

Re: [PHP-DEV] function overloading

2016-11-15 Thread Michael Morris
On Tue, Nov 15, 2016 at 11:14 AM Dominic Grostate < codekest...@googlemail.com> wrote: > I think this may have been discussed before, but I was largely dismissed > because no one though it would be possible to implement. > > However assuming it is possible, what is the general feeling towards > fu

Re: [PHP-DEV] function overloading

2016-11-15 Thread Alice Wonder
On 11/15/2016 08:13 AM, Dominic Grostate wrote: I think this may have been discussed before, but I was largely dismissed because no one though it would be possible to implement. However assuming it is possible, what is the general feeling towards function overloading, as seen in C# and Java? *

Re: [PHP-DEV] function overloading

2016-11-15 Thread Rowan Collins
On 15/11/2016 16:13, Dominic Grostate wrote: I think this may have been discussed before, but I was largely dismissed because no one though it would be possible to implement. My first thoughts are not to do with implementation, but impact on the rest of the language: language complexity, and

[PHP-DEV] function overloading

2016-11-15 Thread Dominic Grostate
I think this may have been discussed before, but I was largely dismissed because no one though it would be possible to implement. However assuming it is possible, what is the general feeling towards function overloading, as seen in C# and Java? To me, it saves me coming up with convoluted names f

Re: [PHP-DEV] function overloading

2014-12-03 Thread Rasmus Lerdorf
On 12/03/2014 01:40 PM, Robert Stoll wrote: > Heya, > > > > I would like to know If it is somehow possible to overload existing functions > by extensions. And if it is possible, are > there already some extension doing it? > > I am not talking about the magic __call function. I am talking ab

Re: [PHP-DEV] function overloading

2014-12-03 Thread Andrea Faulds
Hi! > On 3 Dec 2014, at 21:40, Robert Stoll wrote: > > Heya, > > > > I would like to know If it is somehow possible to overload existing functions > by extensions. And if it is possible, are > there already some extension doing it? Possibly in an extension, maybe. But as a weakly-typed, dy

[PHP-DEV] function overloading

2014-12-03 Thread Robert Stoll
Heya, I would like to know If it is somehow possible to overload existing functions by extensions. And if it is possible, are there already some extension doing it? I am not talking about the magic __call function. I am talking about something like: let's assume GMP has overloaded the funct