Version: 4.2.2 (using KDE 4.6.4) OS: Linux Short example: abstract class MyAbstractClass { static function makeInstanceOfSubclass(){ $obj = new static(); return $obj; } } kdevelop reports problem on "static()": Problem in Parser: Expected symbol "classNameReference" (current token: "static" [1136] at 415:14 - 415:19) This piece of code constructs an instance of a subclass of this abstract class and works in php>=5.3. Reproducible: Always Steps to Reproduce: Make a php file with code above Expected Results: there should be no error OS: Linux (x86_64) release 2.6.37.1-1.2-desktop Compiler: gcc
confirmed - this is valid php code; static is used for late state binding.
Git commit 1bf45f0cb2fe95bba2c5a8bc1e7f957d5f12c3b3 by Heinz Wiesinger. Committed on 18/07/2013 at 13:51. Pushed by wiesinger into branch 'master'. Fix support for PHP 5.3's late static binding. This is still not 100% correct, but since "static" is evaluated at runtime we can not determine at parsing what class type it really is. However, it's always gonna be either the class it was declared in or one that extends the class it was declared in, so using that class as type should provide better information than for example mixed. REVIEW: 111598 M +1 -1 duchain/builders/typebuilder.cpp M +6 -5 duchain/expressionvisitor.cpp M +11 -0 duchain/helper.cpp M +18 -0 duchain/tests/expressionparser.cpp M +1 -0 duchain/tests/expressionparser.h M +1 -0 parser/php.g http://commits.kde.org/kdev-php/1bf45f0cb2fe95bba2c5a8bc1e7f957d5f12c3b3
*** Bug 244073 has been marked as a duplicate of this bug. ***