Edit report at https://bugs.php.net/bug.php?id=60367&edit=1

 ID:                 60367
 Updated by:         larue...@php.net
 Reported by:        woody dot gilk at kohanaframework dot org
 Summary:            Reflection and Late Static Binding
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   OSX 10.6.8
 PHP Version:        5.3.8
 Assigned To:        laruence
 Block user comment: N
 Private report:     N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------
[2011-11-24 09:15:59] larue...@php.net

Automatic comment from SVN on behalf of laruence
Revision: http://svn.php.net/viewvc/?view=revision&revision=319745
Log: Fixed bug #60367 (Reflection and Late Static Binding)

------------------------------------------------------------------------
[2011-11-23 16:57:44] woody dot gilk at kohanaframework dot org

Description:
------------
When calling a method that exists only in the parent class with Reflection, the 
incorrect class is used.

This bug is highly related to #53742, but has a different test case. The root 
cause may be exactly the same.

Test script:
---------------
abstract class A {

        const WHAT = 'wrong';

        public static function call() {
                echo static::WHAT;
        }

}

class B extends A {

        const WHAT = 'correct';

}

B::call();

$class = new ReflectionClass('B');
$class->getMethod('call')->invoke(null);


Expected result:
----------------
"correct"

Actual result:
--------------
"wrong"


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60367&edit=1

Reply via email to