ID: 24608
Updated by: [EMAIL PROTECTED]
Reported By: jaanus at heeringson dot com
-Status: Verified
+Status: Closed
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5CVS-2003-11-29
New Comment:
OK, this code actually cannot work (since __set cannot receive the
right data to set style['temp'] - it gets only property name, and
style['temp'] is not a name). However, you certailnly can make array
beforenahd and then assign it to $test->style and it will go through
the accessor.
I have fixed it to give an error in this case and not to do things
which it is not supposed to do.
Previous Comments:
------------------------------------------------------------------------
[2003-09-16 02:13:17] [EMAIL PROTECTED]
Have you tried adding a __get() function into the class, and seeing if
this returns the same output?
------------------------------------------------------------------------
[2003-07-11 12:48:38] jaanus at heeringson dot com
Description:
------------
When overloading a class with a property containing an array by
assigning an element to to the new array the __set handle does not
fire, but the element gets created.
Reproduce code:
---------------
<?php
class myclass {
public function __set($name,$data) {
echo("Name: {$name}<br/>\nData: {$data}<br/>\n"); //prints out input
when fired
}
}
$test=new myclass();
$test->style['temp']='content'; //creates a new property
print_r($test->style); //check if property is created
?>
Expected result:
----------------
Results from the echo in __set
Actual result:
--------------
The result of the print_r shows that the property is created, but id
did not pass the __set
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24608&edit=1