ID:               42681
 Updated by:       [EMAIL PROTECTED]
 Reported By:      alex94040 at yahoo dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         Class/Object related
-Operating System: Windows
+Operating System: *
 PHP Version:      5.2.4
-Assigned To:      
+Assigned To:      helly
 New Comment:

Marcus, can you reply to this please?


Previous Comments:
------------------------------------------------------------------------

[2007-09-16 03:36:20] alex94040 at yahoo dot com

Description:
------------
This is a reactivation of bug 28442; that bug shows as "fixed/closed",
but the issue still repros. 

We need to be able to redefine static members of classes (including
constants), and set them independently.

Reproduce code:
---------------
class ClassA
{
   private  static   $cn;

   public static function setName( $cn )
   {
      self::$cn   = $cn;
   }

   public static function  getName( )
   {
      return self::$cn;
   }
}

class ClassB extends ClassA
{
   private  static   $cn; // with or without this, result is the same
}

ClassA::setName( 'AAA' );
ClassB::setName( 'BBB' );

print( ClassA::getName() . "\n" ); // prints 'BBB'
print( ClassB::getName() . "\n" ); // prints 'BBB'


Expected result:
----------------
Result should read "AAA BBB"

Actual result:
--------------
Result actually reads "BBB BBB"


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


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

Reply via email to