On Tue, Mar 19, 2013 at 5:35 PM, Daniele Orlando <dnl.r...@gmail.com> 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 check at all), > implementing a callable class could break existing code. > > At the moment a class and a function with the same name can coexist, > but implementing a callable class would mess this state of affairs. > With the adoption of the namespaces, I think that this collisions could > became > so rare to not exist, but of course we cannot ignore pre existing > situations. > > As suggested by Patrick Schaaf, a workaround is to implement a function, > with > the same name of the class, that behaves like a wrapper for a method call. > It is a good point, but has the negative side that it must be implemented > for every > class who follow this pattern. It is not usable in a framework for example. > > It seams that to handle consistently a callable class is to modify PHP > to treat functions/classes names case sensitive and to trigger an > E_WARNING (or similar) in case of collision. > In this way new code could take advantage of the new syntax and old code > could simply suppress the warning. > > What do you think? > > pls don't top post on this list. about the idea: I think that it would be a really major change and doing that for the sake of a feature which only a small percentage of the userbase would ever use seems to be a bad idea. -- Ferenc Kovács @Tyr43l - http://tyrael.hu