-
Notifications
You must be signed in to change notification settings - Fork 651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow calling methods by a literal string variable #8538
Comments
I found these snippets: https://psalm.dev/r/501d719ba6<?php
class a {
public static function a(): int { return 0; }
public static function b(): string { return "test"; }
}
$c = random_int(0, 1) ? 'a' : 'b';
/** @psalm-trace $c */;
$c = a::$c();
/** @psalm-trace $c */;
|
I'm quite surprised it doesn't work. It's not even an issue with the |
Related: #5743 (comment)
|
I found these snippets: https://psalm.dev/r/13a7a514f3<?php
$callable = "is_array";
$test = $callable([]);
/** @psalm-trace $test */;
|
I don't think this was intentional, more like a nice to have feature that never made it. Now that we had an RFC to declare what we can and can't do with callable-arrays, it makes even more sense to support all that is still relevant |
https://psalm.dev/r/501d719ba6
The text was updated successfully, but these errors were encountered: