On Wed, 1 Jul 2020 at 20:40, Larry Garfield <[email protected]> wrote:
> it would also offer a way to do effectively the same thing
One use-case that would need to be covered for that would be for
callables where you don't know how many parameters there would be in
the callable.
> duplicate functionality needlessly.
Good chance it might still be nice. Not only is the syntax a little
bit nicer imo:
// For some class
class Foo {
public static function quux() {
echo "I am quux";
}
}
// Partial version
[Foo::class, 'quux'](?);
// Dedicated version
$(Foo, quux);
As I find it easier to read, but also avoiding using strings to
reference functions/classes is probably less ambiguous for both humans
and computers.
cheers
Dan
Ack
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php