mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-11 17:09:41 +01:00
d5180f0d95
Class name is an Identifier, not a Name.
28 lines
365 B
Plaintext
28 lines
365 B
Plaintext
Anonymous classes
|
|
-----
|
|
<?php
|
|
new class
|
|
($x)
|
|
extends X
|
|
{ };
|
|
-----
|
|
$new = $stmts[0]->expr;
|
|
$new->class->extends = null;
|
|
$new->args[] = new Expr\Variable('y');
|
|
-----
|
|
<?php
|
|
new class
|
|
($x, $y)
|
|
{ };
|
|
-----
|
|
<?php
|
|
new class
|
|
{};
|
|
-----
|
|
// Ignore name assigned to anon class
|
|
$new = $stmts[0]->expr;
|
|
$new->class->name = new Node\Identifier('Anon1');
|
|
-----
|
|
<?php
|
|
new class
|
|
{}; |