This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 268496

Summary: Missing T_CALLABLE and T_TRAIT_C in the lexer and the parser
Product: php Reporter: junichi11
Component: EditorAssignee: junichi11
Status: VERIFIED FIXED    
Severity: normal CC: amobilia, tmysik
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description junichi11 2016-10-13 04:08:02 UTC
T_CALLABLE(callable) and T_TRAIT_C(__TRAIT__) can be used since PHP5.4. But they are missing in the lexer and the parser. So, the following code is not marked as errors (If they are in a global context, they are syntax errors even if PHP7 is used.):

<?php
const callable = 0;
const __TRAIT__ = "__TRAIT__";

Probably, this should be fixed before the issue 262141 is fixed. I'll try it.

Thanks.
Comment 1 Tomas Mysik 2016-10-13 05:45:37 UTC
Thanks a lot!
Comment 2 junichi11 2016-10-19 01:58:49 UTC
Fixed.

Probably, the print() method was forgotten to add in the PrintASTVisitor.visit(ReturnStatement).
So, I've added it.

http://hg.netbeans.org/web-main/rev/dccae1d847b6

Thanks.
Comment 3 Tomas Mysik 2016-10-19 06:18:36 UTC
As always, thanks a lot, Junichi!
Comment 4 junichi11 2016-10-19 22:53:01 UTC
You are welcome :)
Comment 5 Quality Engineering 2016-10-20 01:58:31 UTC
Integrated into 'main-silver', will be available in build *201610200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/dccae1d847b6
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #268496 - Missing T_CALLABLE and T_TRAIT_C in the lexer and the parser
Comment 6 Tomas Mysik 2016-12-03 12:33:11 UTC
Marking as a patch candidate as well (needed to harmless hg transplant of other changes to PHP parser).

Thanks.
Comment 7 Tomas Mysik 2016-12-03 14:08:38 UTC
Transplanted to the releases repo branch release82:

http://hg.netbeans.org/releases/rev/5c0353286c32

Thanks.
Comment 8 amobilia 2016-12-15 12:13:02 UTC
82patch1-verified