From:             guth at fiifo dot u-psud dot fr
Operating system: *
PHP version:      5.0.3
PHP Bug Type:     Unknown/Other Function
Bug description:  Incoherent behaviour

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

Classes A/B and C/D are identical, i just changed a default value from an
'int' to an 'array'.

See at the expected and actual results to understand the problem.



Reproduce code:
---------------
<?php
class A {

        protected static $plop = 42;

}

class B extends A {

        public function __construct() {
                self::$plop = 43;
                var_dump(self::$plop);
        }

}

new B;


class C {

        protected static $plop = array('42');
        
        public function __construct() {
                self::$plop = array('12');
        }

}

class D extends C {

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

}

new D;
?>

Expected result:
----------------
int(43)
array(1) { [0]=>  string(2) "43" }

Actual result:
--------------
int(43)
array(1) { [0]=>  string(2) "42" }

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

Reply via email to