-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Anonymous class not tokenized correctly when used as argument to another anon class #2297
Comments
@jrfnl The code I've provided is valid, it was the minimal code example to show the problem. You are adding closure. See working example: <?php
$x = new class(
new class implements \Countable {
public function count() {
return 17;
}
}
) extends DateTime {
private $c;
public function __construct(\Countable $c) {
$this->c = $c;
}
public function c() {
return $this->c->count();
}
};
echo $x->c(); and tokenizer is still wrong:
|
@webimpress Yes, sorry about that. I realized too late you were trying to pass a new anonymous class as a parameter to another anonymous class. |
I can confirm that the problem is that the first |
Code example:
is tokenized as:
With the token also
scope_opener
andscope_closer
are missing, but I guess when tokenizer will recognize this token correctly then everything will be fine.The text was updated successfully, but these errors were encountered: