ID:               29647
 User updated by:  mrpyle at libero dot it
 Reported By:      mrpyle at libero dot it
 Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: ANY
 PHP Version:      5.0.0
 New Comment:

Could you explain yourself better please?

If this isn't a bug IMHO it is a wrong/not desiderable behaviour:

self:: should refer to the current class and parent:: to the parent
class, if not this means that you cannot apply inheritance to classes
containing static members


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

[2004-08-13 19:26:23] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

self is bound at compile time.

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

[2004-08-13 12:17:33] mrpyle at libero dot it

Description:
------------
self:: into child class seems to refer to parent class, is this a bug?

Reproduce code:
---------------
<?php

abstract class ParentClass
{

  static public function modifyStaticProp($propName, $propValue)
  {
  
      self::${$propName} = $propValue ;

  }

}

class ChildClass extends ParentClass
{

   static public $a ;
   static public $b ;

}


ChildClass::modifyStaticProp('a', 'some value') ;




?>

Expected result:
----------------
ChildClass::$a == 'some value' ;

Actual result:
--------------
Fatal error: Access to undeclared static property: ParentClass::$a in
c:\phproot\static\bug.php5 on line 9


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


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

Reply via email to