2008/10/28 Stan Vassilev | FM <[EMAIL PROTECTED]>:
>> <?php
>> class Test
>> {
>> public function hello($who)
>> {
>> echo 'Hello ' . $who;
>> }
>> }
>>
>> $closure = function()
>> {
>> static $instance;
>>
>> if(!$instance)
>> {
>> $instance = new Test;
>> }
>>
>> return($instance);
>> };
>>
>> $closure->hello('Kalle'); // Fatal error, undefined method
>> Closure::hello()
>>
>> But you should indeed make an RFC for this and even create a patch if
>> you're able to :)
>
> Technically since the closure holds a function returning the object, it
> should be:

doh yes, I must be sleeping :)

>
> $closure()->hello('Kalle');
>
> Regards, Stan Vassilev
>



-- 
Kalle Sommer Nielsen

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to