php-parser/test/code/expr/fetchAndCall/simple.test

74 lines
1.1 KiB
Plaintext
Raw Normal View History

2011-11-27 11:20:35 +01:00
Simple fetches (array, property, constant) and calls
-----
<?php
// simple calls
$a->b();
// simple properties
$a->b;
A::$b;
// simple array access
$a[$b];
$a{$b};
// simple constants
A;
A::B;
-----
array(
0: Expr_MethodCall(
2011-11-27 11:20:35 +01:00
var: Expr_Variable(
name: a
)
name: b
args: array(
)
)
1: Expr_PropertyFetch(
2011-11-27 11:20:35 +01:00
var: Expr_Variable(
name: a
)
name: b
)
2: Expr_StaticPropertyFetch(
2011-11-27 11:20:35 +01:00
class: Name(
parts: array(
0: A
)
)
name: b
)
3: Expr_ArrayDimFetch(
2011-11-27 11:20:35 +01:00
var: Expr_Variable(
name: a
)
dim: Expr_Variable(
name: b
)
)
4: Expr_ArrayDimFetch(
2011-11-27 11:20:35 +01:00
var: Expr_Variable(
name: a
)
dim: Expr_Variable(
name: b
)
)
5: Expr_ConstFetch(
2011-11-27 11:20:35 +01:00
name: Name(
parts: array(
0: A
)
)
)
6: Expr_ClassConstFetch(
2011-11-27 11:20:35 +01:00
class: Name(
parts: array(
0: A
)
)
name: B
)
)