From:             guth at fiifo dot u-psud dot fr
Operating system: Linux
PHP version:      5.0.2
PHP Bug Type:     Zend Engine 2 problem
Bug description:  static properties don't work properly

Description:
------------
hello,

Yet another strange behaviour in PHP...

My english is always too bad to explain the problem, so have a look to the
following code...

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

class A {

        protected static $property = TRUE;
        
        protected static function method() {
                return TRUE;
        }

}

class B extends A {

        public function __construct() {
                
                var_dump(self::method());
                var_dump(parent::method());
                
                var_dump(self::$property);
                var_dump(parent::$property);
        
        }
        
}

new B;
?>


Expected result:
----------------
bool(true)
bool(true)
bool(true)
bool(true)

Actual result:
--------------
bool(true)
bool(true)
bool(true)
Fatal error: Cannot access protected property A::$property in
/www/test2.php on line 21

-- 
Edit bug report at http://bugs.php.net/?id=30451&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30451&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30451&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30451&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30451&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30451&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30451&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30451&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30451&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30451&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30451&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30451&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30451&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30451&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30451&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30451&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30451&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30451&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30451&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30451&r=mysqlcfg

Reply via email to