Re: [PHP-DEV] Allow all callables to be called directly
On 3/15/13 11:11 AM, Nikita Popov wrote: I don't know why 'class::method' isn't supported, but I guess it's just a legacy syntax that was superseded by the array notation 'class::method' was added significantly *later*, so I think it's fair for devs to assume that it would be supported like other callables... Anyway, file under Would Be Nice Someday. Steve Clay -- http://www.mrclay.org/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Allow all callables to be called directly
2013/3/15 Steve Clay > My subject was misleading. I didn't mean to suggest call_user_func() be > removed, just be made unnecessary by direct call syntax. > > This should make the inconsistency clearer: http://3v4l.org/L8Yvq > > On 3/15/13 10:21 AM, Sebastian Krebs wrote: > >> You don't need to use it, if you don't like it. >> > > I do need to use in case my $callable is an object callback. > Well, I would agree, if it is wouldn't be already possible :) You simply defined your static method "wrong" http://3v4l.org/IrPTn I am unsure, if it useful to support "Foo::bar" too, because it doesn't give any further benefit compared to ["Foo","bar"] > > > Steve Clay > -- > http://www.mrclay.org/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- github.com/KingCrunch
Re: [PHP-DEV] Allow all callables to be called directly
On Fri, Mar 15, 2013 at 4:05 PM, Steve Clay wrote: > My subject was misleading. I didn't mean to suggest call_user_func() be > removed, just be made unnecessary by direct call syntax. > > This should make the inconsistency clearer: http://3v4l.org/L8Yvq > > On 3/15/13 10:21 AM, Sebastian Krebs wrote: > >> You don't need to use it, if you don't like it. >> > > I do need to use in case my $callable is an object callback. > I think you missed something. We already support that in 5.4. You can do $foo = ['class', 'method']; $foo() and $foo = [$obj, 'method']; $foo(). I don't know why 'class::method' isn't supported, but I guess it's just a legacy syntax that was superseded by the array notation and as such not supported. Nikita
[PHP-DEV] Allow all callables to be called directly
My subject was misleading. I didn't mean to suggest call_user_func() be removed, just be made unnecessary by direct call syntax. This should make the inconsistency clearer: http://3v4l.org/L8Yvq On 3/15/13 10:21 AM, Sebastian Krebs wrote: You don't need to use it, if you don't like it. I do need to use in case my $callable is an object callback. Steve Clay -- http://www.mrclay.org/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php