We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example:
<?php class Foo { private $bar = 'baz'; } class Test { public static function run () { $getter = function () { return $this->bar; }; $closure = Closure::bind($getter, new Foo(), Foo::class); return $closure(); } } echo Test::run() . "\r\n";
Reports error $this can not be used in static methods.:
$this can not be used in static methods.
{ "resource": "/closure.php", "owner": "_generated_diagnostic_collection_name_#2", "severity": 8, "message": "$this can not be used in static methods.", "source": "php", "startLineNumber": 9, "startColumn": 41, "endLineNumber": 9, "endColumn": 46 }
Code itself is valid:
$ php -l closure.php No syntax errors detected in closure.php $ php closure.php baz
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Example:
Reports error
$this can not be used in static methods.
:Code itself is valid:
$ php -l closure.php No syntax errors detected in closure.php $ php closure.php baz
The text was updated successfully, but these errors were encountered: