mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-07-25 00:01:45 +02:00
In most circumstances we are interested in the whole string, not the parts split by namespace separator. As names are common, this representation measurably improves memory usage and performance.
45 lines
804 B
Plaintext
45 lines
804 B
Plaintext
Assigning new by reference (PHP 5 only)
|
|
-----
|
|
<?php
|
|
$a =& new B;
|
|
-----
|
|
!!version=5.6
|
|
array(
|
|
0: Stmt_Expression(
|
|
expr: Expr_AssignRef(
|
|
var: Expr_Variable(
|
|
name: a
|
|
)
|
|
expr: Expr_New(
|
|
class: Name(
|
|
name: B
|
|
)
|
|
args: array(
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
-----
|
|
<?php
|
|
$a =& new B;
|
|
-----
|
|
!!version=7.0
|
|
Cannot assign new by reference from 2:1 to 2:11
|
|
array(
|
|
0: Stmt_Expression(
|
|
expr: Expr_AssignRef(
|
|
var: Expr_Variable(
|
|
name: a
|
|
)
|
|
expr: Expr_New(
|
|
class: Name(
|
|
name: B
|
|
)
|
|
args: array(
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|