From:             jbeall at heraldic dot us
Operating system: Linux
PHP version:      5.0.0
PHP Bug Type:     Zend Engine 2 problem
Bug description:  __get and __set are not called when placed in a class that has a 
parent class

Description:
------------
the __get() and __set() functions work fine to overload a class when that
class has no parent class.  However, if the class you put __get() and
__set() in has a parent class, they are not called whenever a property is
called.

Reproduce code:
---------------
class Sub
{
}

class Super extends Sub
{
        function __get($prop)
        {
                echo "Property $prop called\n";
        }

        function __set($prop, $val)
        {
                echo "Property $prop set to $val\n";
        }
}


$foo = new Sub();

$foo->someProp = 10;
echo $foo->someProp;

Expected result:
----------------
Property someProp set to 10
Property someProp called

Actual result:
--------------
10

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

Reply via email to