1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-11 08:59:46 +01:00
PHP-Parser/test/code/parser/expr/fetchAndCall/staticCall.test

214 lines
4.6 KiB
Plaintext
Raw Normal View History

Static calls
-----
<?php
// method name variations
A::b();
A::{'b'}();
A::$b();
A::$b['c']();
A::$b['c']['d']();
// array dereferencing
A::b()['c'];
// class name variations
static::b();
$a::b();
${'a'}::b();
$a['b']::c();
-----
2015-06-13 14:59:24 +02:00
!!php5
array(
2017-01-19 22:25:22 +01:00
0: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
comments: array(
0: // method name variations
)
)
name: Identifier(
name: b
)
2017-01-19 22:25:22 +01:00
args: array(
)
comments: array(
0: // method name variations
)
)
comments: array(
0: // method name variations
)
)
2017-01-19 22:25:22 +01:00
1: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
)
2017-01-19 22:25:22 +01:00
name: Scalar_String(
value: b
)
args: array(
)
)
)
2017-01-19 22:25:22 +01:00
2: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
)
2017-01-19 22:25:22 +01:00
name: Expr_Variable(
name: b
)
2017-01-19 22:25:22 +01:00
args: array(
)
)
)
2017-01-19 22:25:22 +01:00
3: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
)
2017-01-19 22:25:22 +01:00
name: Expr_ArrayDimFetch(
var: Expr_Variable(
name: b
)
dim: Scalar_String(
value: c
)
)
2017-01-19 22:25:22 +01:00
args: array(
)
)
)
2017-01-19 22:25:22 +01:00
4: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
2017-01-19 22:25:22 +01:00
)
name: Expr_ArrayDimFetch(
var: Expr_ArrayDimFetch(
var: Expr_Variable(
name: b
2017-01-19 22:25:22 +01:00
)
dim: Scalar_String(
value: c
)
)
dim: Scalar_String(
value: d
)
)
args: array(
)
)
)
5: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
comments: array(
0: // array dereferencing
)
)
name: Identifier(
name: b
)
2017-01-19 22:25:22 +01:00
args: array(
)
comments: array(
0: // array dereferencing
)
)
2017-01-19 22:25:22 +01:00
dim: Scalar_String(
value: c
)
comments: array(
0: // array dereferencing
)
)
comments: array(
0: // array dereferencing
)
)
2017-01-19 22:25:22 +01:00
6: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: static
)
comments: array(
0: // class name variations
)
)
name: Identifier(
name: b
)
2017-01-19 22:25:22 +01:00
args: array(
)
comments: array(
0: // class name variations
)
)
comments: array(
0: // class name variations
)
)
2017-01-19 22:25:22 +01:00
7: Stmt_Expression(
expr: Expr_StaticCall(
class: Expr_Variable(
name: a
)
name: Identifier(
name: b
)
2017-01-19 22:25:22 +01:00
args: array(
)
)
)
2017-01-19 22:25:22 +01:00
8: Stmt_Expression(
expr: Expr_StaticCall(
class: Expr_Variable(
name: Scalar_String(
value: a
)
)
name: Identifier(
name: b
)
2017-01-19 22:25:22 +01:00
args: array(
)
)
)
2017-01-19 22:25:22 +01:00
9: Stmt_Expression(
expr: Expr_StaticCall(
class: Expr_ArrayDimFetch(
var: Expr_Variable(
name: a
)
dim: Scalar_String(
value: b
)
)
name: Identifier(
name: c
)
2017-01-19 22:25:22 +01:00
args: array(
)
)
)
)