mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 01:22:23 -04:00
28 lines
No EOL
365 B
Text
28 lines
No EOL
365 B
Text
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
|
|
{}; |