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 270092

Summary: method names that are PHP keywords marked as syntax errors
Product: php Reporter: neufena
Component: EditorAssignee: issues@php <issues>
Status: RESOLVED DUPLICATE    
Severity: normal CC: junichi11
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Syntax error for valid PHP7 code

Description neufena 2017-03-16 14:22:54 UTC
Created attachment 163863 [details]
Syntax error for valid PHP7 code

As of PHP7 keywords can be used as property, constant, and method names (except class may not be a constant).  See http://php.net/manual/en/reserved.keywords.php.

For example:

class Factory
{
    public static function new()
    {
        //code to create something new
    }
}
Comment 1 junichi11 2017-03-28 23:09:28 UTC

*** This bug has been marked as a duplicate of bug 262141 ***