File tree 3 files changed +79
-0
lines changed
3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ final abstract class Foo {}
Original file line number Diff line number Diff line change @@ -803,6 +803,76 @@ Program {
803
803
}
804
804
` ;
805
805
806
+ exports [` byref staticlookup #7 1` ] = `
807
+ Program {
808
+ " children" : Array [
809
+ ExpressionStatement {
810
+ " expression" : AssignRef {
811
+ " kind" : " assignref" ,
812
+ " left" : Variable {
813
+ " curly" : false ,
814
+ " kind" : " variable" ,
815
+ " name" : " var" ,
816
+ },
817
+ " right" : Call {
818
+ " arguments" : Array [],
819
+ " kind" : " call" ,
820
+ " what" : StaticLookup {
821
+ " kind" : " staticlookup" ,
822
+ " offset" : Identifier {
823
+ " kind" : " identifier" ,
824
+ " name" : " getElementByPath" ,
825
+ },
826
+ " what" : ParentReference {
827
+ " kind" : " parentreference" ,
828
+ " raw" : " parent" ,
829
+ },
830
+ },
831
+ },
832
+ },
833
+ " kind" : " expressionstatement" ,
834
+ },
835
+ ],
836
+ " errors" : Array [],
837
+ " kind" : " program" ,
838
+ }
839
+ ` ;
840
+
841
+ exports [` byref staticlookup #8 1` ] = `
842
+ Program {
843
+ " children" : Array [
844
+ ExpressionStatement {
845
+ " expression" : AssignRef {
846
+ " kind" : " assignref" ,
847
+ " left" : Variable {
848
+ " curly" : false ,
849
+ " kind" : " variable" ,
850
+ " name" : " var" ,
851
+ },
852
+ " right" : Call {
853
+ " arguments" : Array [],
854
+ " kind" : " call" ,
855
+ " what" : StaticLookup {
856
+ " kind" : " staticlookup" ,
857
+ " offset" : Identifier {
858
+ " kind" : " identifier" ,
859
+ " name" : " getElementByPath" ,
860
+ },
861
+ " what" : SelfReference {
862
+ " kind" : " selfreference" ,
863
+ " raw" : " self" ,
864
+ },
865
+ },
866
+ },
867
+ },
868
+ " kind" : " expressionstatement" ,
869
+ },
870
+ ],
871
+ " errors" : Array [],
872
+ " kind" : " program" ,
873
+ }
874
+ ` ;
875
+
806
876
exports [` byref staticlookup 1` ] = `
807
877
Program {
808
878
" children" : Array [
Original file line number Diff line number Diff line change @@ -91,6 +91,12 @@ describe('byref', () => {
91
91
it ( 'staticlookup #6' , ( ) => {
92
92
expect ( parser . parseEval ( '$var = &$var::$$$test;' ) ) . toMatchSnapshot ( ) ;
93
93
} ) ;
94
+ it ( 'staticlookup #7' , ( ) => {
95
+ expect ( parser . parseEval ( '$var = &parent::getElementByPath();' ) ) . toMatchSnapshot ( ) ;
96
+ } ) ;
97
+ it ( 'staticlookup #8' , ( ) => {
98
+ expect ( parser . parseEval ( ' $var = &self::getElementByPath();' ) ) . toMatchSnapshot ( ) ;
99
+ } ) ;
94
100
// https://github.com/php/php-src/blob/php-7.4.0beta4/Zend/zend_language_parser.y#L1169
95
101
it ( 'propertylookup' , ( ) => {
96
102
expect ( parser . parseEval ( '$var = &$var->test;' ) ) . toMatchSnapshot ( ) ;
You can’t perform that action at this time.
0 commit comments