ID:               31686
 Updated by:       [EMAIL PROTECTED]
 Reported By:      guth at fiifo dot u-psud dot fr
-Status:           Open
+Status:           Feedback
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5.0.3
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip




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

[2005-01-25 15:37:27] guth at fiifo dot u-psud dot fr

replace "array(1) { [0]=>  string(2) "43" }" by "array(1) { [0]=> 
string(2) "12" }" in expected result.

sorry for the mistake..

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

[2005-01-25 12:29:36] guth at fiifo dot u-psud dot fr

This is the reproduce code:
<?php
class A {

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

}

class B extends A {

        public function __construct() {
                parent::__construct();
                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;
?>

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

[2005-01-25 12:26:24] guth at fiifo dot u-psud dot fr

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 this bug report at http://bugs.php.net/?id=31686&edit=1

Reply via email to