Bug #77880 [NEW]: Incorrect tree for scope resolution operator specified before class declaration

From: Date: Fri, 12 Apr 2019 05:58:14 +0000
Subject: Bug #77880 [NEW]: Incorrect tree for scope resolution operator specified before class declaration
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220410@lists.php.net to get a copy of this message
From: sobisht at adobe dot com Operating system: Win Mac PHP version: 7.1.28 Package: Scripting Engine problem Bug Type: Bug Bug description:Incorrect tree for scope resolution operator specified before class declaration 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 bug report at https://bugs.php.net/bug.php?id=77880&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77880&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77880&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77880&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77880&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77880&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77880&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77880&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77880&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77880&r=support Expected behavior: https://bugs.php.net/fix.php?id=77880&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77880&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77880&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77880&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77880&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77880&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77880&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77880&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77880&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77880&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77880&r=mysqlcfg

« previous php.bugs (#220410) next »