mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-27 04:24:43 +01:00
Fix pretty printing of const derefs for 5.x
(FOO)[0] is only supported on 7.x
This commit is contained in:
parent
49253c5dbb
commit
8090531acd
@ -788,6 +788,9 @@ class Standard extends PrettyPrinterAbstract
|
|||||||
|| $node instanceof Expr\MethodCall
|
|| $node instanceof Expr\MethodCall
|
||||||
|| $node instanceof Expr\StaticCall
|
|| $node instanceof Expr\StaticCall
|
||||||
|| $node instanceof Expr\Array_
|
|| $node instanceof Expr\Array_
|
||||||
|
|| $node instanceof Scalar\String_
|
||||||
|
|| $node instanceof Expr\ConstFetch
|
||||||
|
|| $node instanceof Expr\ClassConstFetch
|
||||||
) {
|
) {
|
||||||
return $this->p($node);
|
return $this->p($node);
|
||||||
} else {
|
} else {
|
||||||
|
13
test/code/prettyPrinter/constant_deref.test
Normal file
13
test/code/prettyPrinter/constant_deref.test
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Constant/literal dereferencing
|
||||||
|
-----
|
||||||
|
<?php
|
||||||
|
|
||||||
|
FOO[0];
|
||||||
|
FOO::BAR[0];
|
||||||
|
'FOO'[0];
|
||||||
|
array(FOO)[0];
|
||||||
|
-----
|
||||||
|
FOO[0];
|
||||||
|
FOO::BAR[0];
|
||||||
|
'FOO'[0];
|
||||||
|
array(FOO)[0];
|
Loading…
Reference in New Issue
Block a user