<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>278085</bug_id>
          
          <creation_ts>2011-07-19 14:03:36 +0000</creation_ts>
          <short_desc>kdevelop does not recognize some php language constructs</short_desc>
          <delta_ts>2014-01-19 11:06:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kdevelop</product>
          <component>Language Support: PHP</component>
          <version>4.2.2</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.2.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="H.H.">cyberbeat</reporter>
          <assigned_to>kdevelop-bugs-null</assigned_to>
          <cc>niko.sams</cc>
    
    <cc>Teyras</cc>
          
          <cf_commitlink>http://commits.kde.org/kdev-php/1bf45f0cb2fe95bba2c5a8bc1e7f957d5f12c3b3</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1143543</commentid>
    <comment_count>0</comment_count>
    <who name="H.H.">cyberbeat</who>
    <bug_when>2011-07-19 14:03:36 +0000</bug_when>
    <thetext>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 &quot;static()&quot;:
Problem in Parser: Expected symbol &quot;classNameReference&quot; (current token: &quot;static&quot; [1136] at 415:14 - 415:19)

This piece of code constructs an instance of a subclass of this abstract class and works in php&gt;=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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1310091</commentid>
    <comment_count>1</comment_count>
    <who name="Niko Sams">niko.sams</who>
    <bug_when>2012-10-28 00:20:31 +0000</bug_when>
    <thetext>confirmed - this is valid php code; static is used for late state binding.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1385319</commentid>
    <comment_count>2</comment_count>
    <who name="Heinz Wiesinger">pprkut</who>
    <bug_when>2013-07-22 19:37:22 +0000</bug_when>
    <thetext>Git commit 1bf45f0cb2fe95bba2c5a8bc1e7f957d5f12c3b3 by Heinz Wiesinger.
Committed on 18/07/2013 at 13:51.
Pushed by wiesinger into branch &apos;master&apos;.

Fix support for PHP 5.3&apos;s late static binding.

This is still not 100% correct, but since &quot;static&quot; is evaluated at runtime
we can not determine at parsing what class type it really is.
However, it&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1425694</commentid>
    <comment_count>3</comment_count>
    <who name="Heinz Wiesinger">pprkut</who>
    <bug_when>2014-01-19 11:06:00 +0000</bug_when>
    <thetext>*** Bug 244073 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>