| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- New in initializers
- -----
- <?php
- const C = new Foo;
- function a($x = new Foo) {
- static $y = new Foo;
- }
- #[Attr(new Foo)]
- class Bar {
- const C = new Foo;
- public $prop = new Foo;
- }
- -----
- !!php7
- array(
- 0: Stmt_Const(
- consts: array(
- 0: Const(
- name: Identifier(
- name: C
- )
- value: Expr_New(
- class: Name(
- parts: array(
- 0: Foo
- )
- )
- args: array(
- )
- )
- )
- )
- )
- 1: Stmt_Function(
- attrGroups: array(
- )
- byRef: false
- name: Identifier(
- name: a
- )
- params: array(
- 0: Param(
- attrGroups: array(
- )
- flags: 0
- type: null
- byRef: false
- variadic: false
- var: Expr_Variable(
- name: x
- )
- default: Expr_New(
- class: Name(
- parts: array(
- 0: Foo
- )
- )
- args: array(
- )
- )
- )
- )
- returnType: null
- stmts: array(
- 0: Stmt_Static(
- vars: array(
- 0: Stmt_StaticVar(
- var: Expr_Variable(
- name: y
- )
- default: Expr_New(
- class: Name(
- parts: array(
- 0: Foo
- )
- )
- args: array(
- )
- )
- )
- )
- )
- )
- )
- 2: Stmt_Class(
- attrGroups: array(
- 0: AttributeGroup(
- attrs: array(
- 0: Attribute(
- name: Name(
- parts: array(
- 0: Attr
- )
- )
- args: array(
- 0: Arg(
- name: null
- value: Expr_New(
- class: Name(
- parts: array(
- 0: Foo
- )
- )
- args: array(
- )
- )
- byRef: false
- unpack: false
- )
- )
- )
- )
- )
- )
- flags: 0
- name: Identifier(
- name: Bar
- )
- extends: null
- implements: array(
- )
- stmts: array(
- 0: Stmt_ClassConst(
- attrGroups: array(
- )
- flags: 0
- type: null
- consts: array(
- 0: Const(
- name: Identifier(
- name: C
- )
- value: Expr_New(
- class: Name(
- parts: array(
- 0: Foo
- )
- )
- args: array(
- )
- )
- )
- )
- )
- 1: Stmt_Property(
- attrGroups: array(
- )
- flags: MODIFIER_PUBLIC (1)
- type: null
- props: array(
- 0: Stmt_PropertyProperty(
- name: VarLikeIdentifier(
- name: prop
- )
- default: Expr_New(
- class: Name(
- parts: array(
- 0: Foo
- )
- )
- args: array(
- )
- )
- )
- )
- )
- )
- )
- )
|