ID: 29175
Updated by: [EMAIL PROTECTED]
Reported By: jbeall at heraldic dot us
-Status: Open
+Status: Bogus
Bug Type: Zend Engine 2 problem
Operating System: Linux
PHP Version: 5.0.0
New Comment:
This is the intended behavior. __get() and __set() are
only triggered when a property *does not* exist.
Previous Comments:
------------------------------------------------------------------------
[2004-07-15 03:56:29] jbeall at heraldic dot us
Description:
------------
If you define a property as public, and then also define the __get()
and __set() functions within the same class, those functions are not
called.
Reproduce code:
---------------
class Sub
{
public $someProp;
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 this bug report at http://bugs.php.net/?id=29175&edit=1