On 06/25/2015 09:31 PM, Christoph Becker wrote:
Marc Bennewitz wrote:

I would really like to see directly calling a string of "Class::method"
be fixed for 7.0.
It's currently resulting in a fatal error and is inconsistent with
call_user_func[_array], is_callable and the callable type-hint.

There is also a PR open since April 2014 :
https://github.com/php/php-src/pull/659
Apparently, your PR has been overlooked, but it seems this is already
implemented as result of merging PR #1264[1]; see
<http://3v4l.org/W8hQA>.  Can you please verify, and close your PR #659
as appropriate.

[1] <https://github.com/php/php-src/pull/1264>


Nice to see this - didn't noted it in the last month :)

But there is one edge case that is not handled by PHP-7 at current behavior;
http://3v4l.org/HkRQ7

class Foo {
    public static function __callStatic($m, $args) {
        var_dump($m);
    }
    public function __call($m, $args) {
        var_dump($m);
    }
}

$callable = [new Foo, ''];
$callable(); // string(0) ""

$callable = 'Foo::';
$callable(); // Fatal error: Uncaught Error: Call to undefined function Foo::()

This behavior is inconsistent!

Thanks
Marc


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

Reply via email to