Bug #77880 [Fbk->NoF]: Incorrect tree for scope resolution operator specified before class declaration

From: Date: Sun, 21 Apr 2019 04:22:04 +0000
Subject: Bug #77880 [Fbk->NoF]: Incorrect tree for scope resolution operator specified before class declaration
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220542@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77880&edit=1 ID: 77880 Updated by: php-bugs@lists.php.net Reported by: sobisht at adobe dot com Summary: Incorrect tree for scope resolution operator specified before class declaration -Status: Feedback +Status: No Feedback Type: Bug Package: Scripting Engine problem Operating System: Win Mac PHP Version: 7.1.28 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2019-04-12 07:38:08] nikic@php.net Can you please provide the ASTs either in human readable format or rendered images? Also, what is this "zend parser" you're talking about? PHP does not come with any tooling to produce ASTs, so you must be using something else to do so. ------------------------------------------------------------------------ [2019-04-12 05:58:14] sobisht at adobe dot com Description: ------------ When we specify a class name with scope resolution operator just before the class description. Then the incorrect syntax tree is parsed by zend parser. When a word is typed after the scope resolution operator, then zend parses correct syntax tree. This issue starts occurring from zend parser for php-5.6 onwards. This issue only occurs in the scenario when scope resolution operator is specified for same class whose declaration has been specified in the next statement. A digraph generated for the syntax tree has been specified in the expected result and actual result. As you can see, when scope resolution operator is specified, the label "SMTP" related to class name gets removed. Test script: --------------- <?php SMTP:: class SMTP { const VERSION = '5.2.22'; } ?> Expected result: ---------------- digraph dbg_AST { rankdir=LR node0 [shape=point, label="<notext>"] node1 [shape=rect, label="SMTP"] node0->node1 node2 [shape=octagon, label="SMTP"] node0->node2 node3 [shape=point, label="<notext>"] node2->node3 node4 [shape=point, label="<notext>"] node2->node4 node5 [shape=point, label="<notext>"] node4->node5 node6 [shape=hexagon, label="VERSION"] node5->node6 node7 [shape=note, label="5.2.22"] node6->node7 node8 [shape=rect, label="?> ¶"] node0->node8 node9 [shape=rect, label="<internal>"] node0->node9 node10 [shape=rect, label=" ¶"] node9->node10 } Actual result: -------------- digraph dbg_AST { rankdir=LR node0 [shape=point, label="<notext>"] node1 [shape=point, label="<notext>"] node0->node1 node2 [shape=note, label="5.2.22"] node1->node2 node3 [shape=rect, label="?> ¶"] node0->node3 node4 [shape=rect, label="<internal>"] node0->node4 node5 [shape=rect, label=" ¶"] node4->node5 } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77880&edit=1

« previous php.bugs (#220542) next »