Re: [PHP-DEV] Lambdas assigned to constants. Was PHP Annotations RFC + Patch

2010-09-18 Thread Alexey Zakhlestin
On Thu, Sep 16, 2010 at 10:35 PM, Stas Malyshev wrote: > Hi! > >> const foo = function () use ($globalVar) { >> >> }; > > How would you call this thing? foo()? Then you have a problem - foo() > already has meaning, and it's "call function named foo", not "get constant > named foo and call function

Re: [PHP-DEV] Lambdas assigned to constants. Was PHP Annotations RFC + Patch

2010-09-16 Thread Stas Malyshev
Hi! const foo = function () use ($globalVar) { }; How would you call this thing? foo()? Then you have a problem - foo() already has meaning, and it's "call function named foo", not "get constant named foo and call function inside if it's there". Also, it would work different from variables