Fix pretty printing of const derefs for 5.x

(FOO)[0] is only supported on 7.x
This commit is contained in:
Nikita Popov 2015-07-09 12:32:12 +02:00
parent 49253c5dbb
commit 8090531acd
2 changed files with 16 additions and 0 deletions

View File

@ -788,6 +788,9 @@ class Standard extends PrettyPrinterAbstract
|| $node instanceof Expr\MethodCall
|| $node instanceof Expr\StaticCall
|| $node instanceof Expr\Array_
|| $node instanceof Scalar\String_
|| $node instanceof Expr\ConstFetch
|| $node instanceof Expr\ClassConstFetch
) {
return $this->p($node);
} else {

View 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];