Uploaded image for project: 'SonarPHP'
  1. SonarPHP
  2. SONARPHP-705

Support keywords as class member names (PHP 7.0)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.11
    • Component/s: Parser
    • Labels:
      None

      Description

      As of PHP 7.0.0 these keywords are allowed as property, constant, and method names of classes, interfaces and traits, except that class may not be used as constant name.

      Keyword documentation page

      E.g. this code fails parsing (both in declaration and usage)

      class A {
        static function list(){} // parse error
      }
      
      $a = new A();
      $a::list(); // parse error
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pierre-yves.nicolas Pierre-Yves Nicolas
              Reporter:
              elena.vilchik Elena Vilchik
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: