From:             bart dot vanbrabant at zoeloelip dot be
Operating system: Linux 2.6.11
PHP version:      5.0.4
PHP Bug Type:     Zend Engine 2 problem
Bug description:  protected member array treated as static

Description:
------------
When using the __get and __set function and extending from a class the
variable of the super class is treated static. The description isn't very
clear but the source code explains it better.

It seems like the super class of the sub class uses a static member or
that the same object is used.

Reproduce code:
---------------
The code snippit is a bit to long (~50lines):
http://zoeloelip.be:81/ea/tests/get_set.php.txt (the code)
http://zoeloelip.be:81/ea/tests/get_set.php (the output)

The server runs php 5.0.3 but on my machine with php 5.0.4 it also gives
this error.

Expected result:
----------------
super::__construct
super: __get
$test at super construction: 10
super: __get
super: __set
super: __get
The value of 'test' is 11
-----------------------------------------
super::__construct
sub: __get
$test at super construction: 10
sub::__construct
sub: __get
$test at sub construction: 10
sub: __get
sub: __set
sub: __get
The value of 'test' in sub::super is 11

Actual result:
--------------
super::__construct
super: __get
$test at super construction: 10
super: __get
super: __set
super: __get
The value of 'test' is 11
------------------------------------------
sub::__construct
sub: __get
$test at sub construction: 11
sub: __get
sub: __set
sub: __get
The value of 'test' in sub::super is 12

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

Reply via email to