php-parser/test/code/formatPreservation/anonClasses.test

28 lines
359 B
Plaintext
Raw Normal View History

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)
2018-12-26 14:19:18 +01:00
{ };
-----
<?php
new class
{};
-----
// Ignore name assigned to anon class
$new = $stmts[0]->expr;
$new->class->name = new Node\Name('Anon1');
-----
<?php
new class
{};