ID: 31686
User updated by: guth at fiifo dot u-psud dot fr
Reported By: guth at fiifo dot u-psud dot fr
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5.0.3
New Comment:
replace "array(1) { [0]=> string(2) "43" }" by "array(1) { [0]=>
string(2) "12" }" in expected result.
sorry for the mistake..
Previous Comments:
------------------------------------------------------------------------
[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