On 24.07.2008, at 11:10, Christian Seiler wrote:
Personally, I don't care whether a object-to-string cast is present or
not.
So lets remove it?
I don't think Closure can be meaningfully exported. Can we prohibit
it?
Unfortunately, currently not, see the var_export code.
I think we can
Hi!
so do we even want the toString() method?
IMHO we should drop toString from Closure.
There is one case which *may* cause problems:
function doSomething ($callback) {
if (!is_callable ($callback)) {
throw new Exception (...);
}
// special treatment
if ($callback == 'default'
Hi!
H, the amount of problems is pretty long. So even though it might sound
cool to do it. It is the better deceision to not allow it. Also you've
shown several paths where it would slow general execution down. Yet I hate
not being able to easily make it work.
Well, $foo->bar->__invoke() i
Hello Stanislav,
Wednesday, July 23, 2008, 12:54:48 AM, you wrote:
> Hi!
>> Nope. It means if you have a function named foo and a property foo that
>> sores a closure and then call foo(), then obviously the function is called
>> rather than the closure.
> That means you can't call the closure,
Hi!
Nope. It means if you have a function named foo and a property foo that
sores a closure and then call foo(), then obviously the function is called
rather than the closure.
That means you can't call the closure, and nothing alerts you of the
problem.
2. We'd have to check properties eve
Hello Stanislav,
Tuesday, July 22, 2008, 11:07:58 PM, you wrote:
> Hi!
>> Can't we change zend_std_get_method() to return a zend_internal_function
>> struct in case of a closure on a property? The only thing that needs to
> That means that:
> 1. We can't have properties named same as functions
Hi!
Can't we change zend_std_get_method() to return a zend_internal_function
struct in case of a closure on a property? The only thing that needs to
That means that:
1. We can't have properties named same as functions anymore
2. We'd have to check properties every time method name was not foun
Hello Stanislav,
Tuesday, July 22, 2008, 10:08:11 PM, you wrote:
> Hi!
>> so do we even want the toString() method?
> IMHO we should drop toString from Closure.
Sam here. It makes no sense anyway. This mail thread just proved that.
>>> Maybe it could return some relevant information for expor
Hello Lars,
actually this is a very good idea and should work :-)
marcus
Tuesday, July 22, 2008, 10:15:03 PM, you wrote:
> Hi Stas,
> Am Dienstag, den 22.07.2008, 13:09 -0700 schrieb Stanislav Malyshev:
> [...]
>> I'm all for doing it, the problem is the syntax $foo->bar() is already
>> us
Hi Stas,
Am Dienstag, den 22.07.2008, 13:09 -0700 schrieb Stanislav Malyshev:
[...]
> I'm all for doing it, the problem is the syntax $foo->bar() is already
> used. But you can do $foo->bar->__invoke()!
Can't we change zend_std_get_method() to return a zend_internal_function
struct in case of a
Hi!
Hm, I'm not sure who expected it that way. At least Stas and myself
voted *for* allowing it. We need to discuss the semantics (the order how
methods are resolved, interceptors) but I had the feeling that most of
use really much liked that feature.
I'm all for doing it, the problem is the s
Hi!
so do we even want the toString() method?
IMHO we should drop toString from Closure.
Maybe it could return some relevant information for exporting the
closure across
data
not a huge biggy to me.
I don't think Closure can be meaningfully exported. Can we prohibit it?
I guess this is
Hi Christian,
Am Dienstag, den 22.07.2008, 14:15 +0200 schrieb Christian Seiler:
>
> >> Calling: $a->b(); will result in method A::B() does not exists.
>
> Yes, that's expected behaviour (we had a few comments on this on the
> list).
Hm, I'm not sure who expected it that way. At least Stas and
Hi Lukas,
1) Closures on class properties just don't work, the only way to do it is
to do something like:
$c = $a->b;
$c();
Calling: $a->b(); will result in method A::B() does not exists.
Yes, that's expected behaviour (we had a few comments on this on the
list). Compare this to, for example
On 22.07.2008, at 13:04, Lukas Kahwe Smith wrote:
1) Closures on class properties just don't work, the only way to do
it is
to do something like:
$c = $a->b;
$c();
Calling: $a->b(); will result in method A::B() does not exists.
would be nice to get this fixed, but at worst it should be do
Hi,
I am sending this on behalf of Kalle:
1) Closures on class properties just don't work, the only way to do it
is
to do something like:
$c = $a->b;
$c();
Calling: $a->b(); will result in method A::B() does not exists.
2) Closures can be defined as constants values because of its toString
16 matches
Mail list logo