Community
Participate
Working Groups
Word 'parent' is highlighted as keyword, but no errors are displayed. To reproduce: <?php class parent { } http://3v4l.org/MBgjE
New Gerrit change created: https://git.eclipse.org/r/141337
Gerrit change https://git.eclipse.org/r/141337 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=b6bb0e936695d124d7b2795387c5a84f35465031
Fixed. Note that my patch does only a minimal and non-intrusive fix by checking that class, interface, trait and namespace declarations don't use "parent", "self" or any of the restricted words defined at https://www.php.net/manual/en/reserved.other-reserved-words.php We could also check class instantiations, class and interface heritage, restrict TI and CA, but php behavior is not trivial (and can also depend on the namespace context). For example, this is *valid* in PHP 7.2: class A extends \self { function foo() { $a = new self(); } } class B extends \parent { } but following examples would result in a different type of error, i.e. a "Class 'float' not found" error: class A extends \float { } class B extends float { } So keep the fix as simple as possible and avoid introducing regressions ;) Thierry.