Re: [PHP-DEV] __invokeStatic() method

2013-03-19 Thread Pierre du Plessis
> It is clear to me that there are valid reasons to say yes to this proposal, > but there are a lot to say no too. > Even if it could be interesting in theory, due to of how PHP handles > collisions between classes and functions names (no check at all), > implementing a callable class could break e

Re: [PHP-DEV] __invokeStatic() method

2013-03-19 Thread Ferenc Kovacs
On Tue, Mar 19, 2013 at 5:35 PM, Daniele Orlando wrote: > It is clear to me that there are valid reasons to say yes to this proposal, > but there are a lot to say no too. > Even if it could be interesting in theory, due to of how PHP handles > collisions between classes and functions names (no ch

Re: [PHP-DEV] __invokeStatic() method

2013-03-19 Thread Daniele Orlando
It is clear to me that there are valid reasons to say yes to this proposal, but there are a lot to say no too. Even if it could be interesting in theory, due to of how PHP handles collisions between classes and functions names (no check at all), implementing a callable class could break existing co

Re: [PHP-DEV] __invokeStatic() method

2013-03-19 Thread Matīss Roberts Treinis
Bruno, Poor or questionable design or language use is not what this discussion is about. PHP's greatest strength is its flexibility - PHP does allow to do silly and sometimes, questionable things. Trying to limit this flexibility is like trying to limit PHP, which is obviously bad thing to do. Exa

Re: [PHP-DEV] __invokeStatic() method

2013-03-19 Thread Patrick Schaaf
On Tuesday 19 March 2013 02:54:19 Bruno CHALOPIN wrote: > Now I don't see why in the world a class and a function could share the same name. Well, for one, I might have code like this: class Foo { public static the_usual() { static $instance; if (!isset($

Re: [PHP-DEV] __invokeStatic() method

2013-03-19 Thread Pierre du Plessis
> Le Tue, 19 Mar 2013 09:37:43 +0200, Pierre du Plessis a écrit : > > It would break existing software if you have a class and function with > > the same name. > > Consider the following example: > > > > class foo { > > } > > > > function foo() > > { > > > > } > > > > Now what if you have several c

Re: [PHP-DEV] __invokeStatic() method

2013-03-19 Thread Bruno CHALOPIN
Le Tue, 19 Mar 2013 09:37:43 +0200, Pierre du Plessis a écrit : > It would break existing software if you have a class and function with > the same name. > Consider the following example: > > class foo { > } > > function foo() > { > > } > > Now what if you have several calls to foo() in your ex

Re: [PHP-DEV] __invokeStatic() method

2013-03-19 Thread Pierre du Plessis
> Hi, > > Le Mon, 18 Mar 2013 09:07:43 +0200, Matīss Roberts Treinis a écrit : > > Not only that. This potentially might break compatibility with many > > software products already out there. > > I don't see how it could break existing software as it is not a > modification of an existing method bu

Re: [PHP-DEV] __invokeStatic() method

2013-03-19 Thread Bruno CHALOPIN
Hi, Le Mon, 18 Mar 2013 09:07:43 +0200, Matīss Roberts Treinis a écrit : > Not only that. This potentially might break compatibility with many > software products already out there. I don't see how it could break existing software as it is not a modification of an existing method but a brand ne

Re: [PHP-DEV] __invokeStatic() method

2013-03-18 Thread David Muir
On 18/03/2013, at 6:07 PM, Matīss Roberts Treinis wrote: > Not only that. This potentially might break compatibility with many > software products already out there. Also, this might lead to many > misunderstandings and, in fact, ambiguous code. Consider the sample. > > $name = 'something'; > $s

Re: [PHP-DEV] __invokeStatic() method

2013-03-18 Thread Matīss Roberts Treinis
Not only that. This potentially might break compatibility with many software products already out there. Also, this might lead to many misunderstandings and, in fact, ambiguous code. Consider the sample. $name = 'something'; $something = $name(); // What is this - a function call or object? Fact

Re: [PHP-DEV] __invokeStatic() method

2013-03-17 Thread Pierre du Plessis
On Mar 18, 2013 2:41 AM, "Thomas Bley" wrote: > > On Sat, Mar 16, 2013 at 9:33 PM, Pierre du Plessis > wrote: > > On Mar 16, 2013 9:35 PM, "Daniele Orlando" wrote: > >> > >> Hi List, > >> > >> I'm interested in proposing an RFC and I would know your opinion. > >> > >> === Current Situation === >

Re: [PHP-DEV] __invokeStatic() method

2013-03-17 Thread Thomas Bley
On Sat, Mar 16, 2013 at 9:33 PM, Pierre du Plessis wrote: > On Mar 16, 2013 9:35 PM, "Daniele Orlando" wrote: >> >> Hi List, >> >> I'm interested in proposing an RFC and I would know your opinion. >> >> === Current Situation === >> Since PHP 5.3 we can use an object instance, who defines the __in

Re: [PHP-DEV] __invokeStatic() method

2013-03-16 Thread Pierre du Plessis
On Mar 16, 2013 9:35 PM, "Daniele Orlando" wrote: > > Hi List, > > I'm interested in proposing an RFC and I would know your opinion. > > === Current Situation === > Since PHP 5.3 we can use an object instance, who defines the __invoke() > method, as a callable object. > Example: > > // PHP Code. >

Re: [PHP-DEV] __invokeStatic() method

2013-03-16 Thread Simon J Welsh
On 17/03/2013, at 8:33 AM, Daniele Orlando wrote: > Hi List, > > I'm interested in proposing an RFC and I would know your opinion. > > === Current Situation === > Since PHP 5.3 we can use an object instance, who defines the __invoke() > method, as a callable object. > Example: > > // PHP Code.

[PHP-DEV] __invokeStatic() method

2013-03-16 Thread Daniele Orlando
Hi List, I'm interested in proposing an RFC and I would know your opinion. === Current Situation === Since PHP 5.3 we can use an object instance, who defines the __invoke() method, as a callable object. Example: // PHP Code. class Runnable { public function __invoke() { echo "Run