From: ian at ardes dot com
Operating system: OS X 10.2.6
PHP version: 4.3.3RC3
PHP Bug Type: Class/Object related
Bug description: overload() messes with array member variables

Description:
------------
Summary: When a class is overloaded with overload(),
array member variables go wrong.

If you overload a class, then access to declared array
member variables from within member functions (and
anywhere else I think) stops working correctly.

The very simple class in the code should not change
it's behaviour at all once it is overloaded. But it
does.

Reproduce code:
---------------
class Overloaded {
var $_my_array = array();

function Overloaded() {
$this->_my_array[1] = '1st element';
}

function __get($nm, &$val) {
return false;
}

function __set($nm, $val) {
return false;
}
}

$o1 = new Overloaded();
print ("before overload(): "); print_r($o1);

overload('Overloaded');

$o2 = new Overloaded();
print ("after overload(): "); print_r($o2);

Expected result:
----------------
before overload(): overloaded Object
(
[_my_array] => Array
(
[1] => 1st element
)

)
after overload(): overloaded Object
(
[_my_array] => Array
(
[1] => 1st element
)

)

Actual result:
--------------
before overload(): overloaded Object
(
[_my_array] => Array
(
[1] => 1st element
)

)
after overload(): overloaded Object
(
[_my_array] => 1st element
)

--
Edit bug report at [url]http://bugs.php.net/?id=25124&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25124&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25124&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25124&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25124&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25124&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25124&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25124&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25124&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25124&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25124&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25124&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25124&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25124&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25124&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25124&r=gnused[/url]