On Tue, Feb 24, 2015 at 9:10 AM, Dmitry Stogov <dmi...@zend.com> wrote:
> I think the proposal is a bit incomplete.
> It's possible to instantiate an anonymous class, but currently it's not
> possible to do with them anything else (assign to variable, pass to
> function, etc). Something similar to Closure objects should be introduced.
>
> Thanks. Dmitry.
>
> On Tue, Feb 24, 2015 at 4:52 PM, Philip Sturgeon <pjsturg...@gmail.com>
> wrote:

1. You can absolutely assign the instantiated classes to variables.

Check out this test in the patch:
https://github.com/krakjoe/php-src/compare/anon#diff-25e330fb5a98810de178a5b798102d01R1

2. Why do you say they cannot be passed to a function? I can add a
test if you can give me an example of what you're suggesting doesn't
work.

3. Not sure why we'd need a Closure-alike object. Anonymous classes
are just a class, and classes have all the types and hinting
functionality of regular classes. You don't need to implement a class
to let people know its a class.

Maybe you could expand on that a bit? :)

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

Reply via email to