2011-12-07 18:17:05 +01:00
|
|
|
Object access
|
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
|
|
|
|
// property fetch variations
|
|
|
|
$a->b;
|
|
|
|
$a->b['c'];
|
|
|
|
$a->b{'c'};
|
|
|
|
|
|
|
|
// method call variations
|
|
|
|
$a->b();
|
|
|
|
$a->{'b'}();
|
|
|
|
$a->$b();
|
|
|
|
$a->$b['c']();
|
|
|
|
|
|
|
|
// array dereferencing
|
|
|
|
$a->b()['c'];
|
|
|
|
$a->b(){'c'}; // invalid PHP: drop Support?
|
|
|
|
-----
|
2015-06-13 14:59:24 +02:00
|
|
|
!!php5
|
2011-12-07 18:17:05 +01:00
|
|
|
array(
|
|
|
|
0: Expr_PropertyFetch(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: a
|
2016-03-09 18:57:16 +01:00
|
|
|
comments: array(
|
|
|
|
0: // property fetch variations
|
|
|
|
)
|
2011-12-07 18:17:05 +01:00
|
|
|
)
|
|
|
|
name: b
|
2016-03-09 18:57:16 +01:00
|
|
|
comments: array(
|
|
|
|
0: // property fetch variations
|
|
|
|
)
|
2011-12-07 18:17:05 +01:00
|
|
|
)
|
|
|
|
1: Expr_ArrayDimFetch(
|
|
|
|
var: Expr_PropertyFetch(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: a
|
|
|
|
)
|
|
|
|
name: b
|
|
|
|
)
|
|
|
|
dim: Scalar_String(
|
|
|
|
value: c
|
|
|
|
)
|
|
|
|
)
|
|
|
|
2: Expr_ArrayDimFetch(
|
|
|
|
var: Expr_PropertyFetch(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: a
|
|
|
|
)
|
|
|
|
name: b
|
|
|
|
)
|
|
|
|
dim: Scalar_String(
|
|
|
|
value: c
|
|
|
|
)
|
|
|
|
)
|
|
|
|
3: Expr_MethodCall(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: a
|
2016-03-09 18:57:16 +01:00
|
|
|
comments: array(
|
|
|
|
0: // method call variations
|
|
|
|
)
|
2011-12-07 18:17:05 +01:00
|
|
|
)
|
|
|
|
name: b
|
|
|
|
args: array(
|
|
|
|
)
|
2016-03-09 18:57:16 +01:00
|
|
|
comments: array(
|
|
|
|
0: // method call variations
|
|
|
|
)
|
2011-12-07 18:17:05 +01:00
|
|
|
)
|
|
|
|
4: Expr_MethodCall(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: a
|
|
|
|
)
|
|
|
|
name: Scalar_String(
|
|
|
|
value: b
|
|
|
|
)
|
|
|
|
args: array(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
5: Expr_MethodCall(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: a
|
|
|
|
)
|
|
|
|
name: Expr_Variable(
|
|
|
|
name: b
|
|
|
|
)
|
|
|
|
args: array(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
6: Expr_MethodCall(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: a
|
|
|
|
)
|
|
|
|
name: Expr_ArrayDimFetch(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: b
|
|
|
|
)
|
|
|
|
dim: Scalar_String(
|
|
|
|
value: c
|
|
|
|
)
|
|
|
|
)
|
|
|
|
args: array(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
7: Expr_ArrayDimFetch(
|
|
|
|
var: Expr_MethodCall(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: a
|
2016-03-09 18:57:16 +01:00
|
|
|
comments: array(
|
|
|
|
0: // array dereferencing
|
|
|
|
)
|
2011-12-07 18:17:05 +01:00
|
|
|
)
|
|
|
|
name: b
|
|
|
|
args: array(
|
|
|
|
)
|
2016-03-09 18:57:16 +01:00
|
|
|
comments: array(
|
|
|
|
0: // array dereferencing
|
|
|
|
)
|
2011-12-07 18:17:05 +01:00
|
|
|
)
|
|
|
|
dim: Scalar_String(
|
|
|
|
value: c
|
|
|
|
)
|
2016-03-09 18:57:16 +01:00
|
|
|
comments: array(
|
|
|
|
0: // array dereferencing
|
|
|
|
)
|
2011-12-07 18:17:05 +01:00
|
|
|
)
|
|
|
|
8: Expr_ArrayDimFetch(
|
|
|
|
var: Expr_MethodCall(
|
|
|
|
var: Expr_Variable(
|
|
|
|
name: a
|
|
|
|
)
|
|
|
|
name: b
|
|
|
|
args: array(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
dim: Scalar_String(
|
|
|
|
value: c
|
|
|
|
)
|
|
|
|
)
|
2015-10-02 11:03:12 +02:00
|
|
|
9: Stmt_Nop(
|
|
|
|
comments: array(
|
|
|
|
0: // invalid PHP: drop Support?
|
|
|
|
)
|
|
|
|
)
|
2016-03-09 18:57:16 +01:00
|
|
|
)
|