Re: Internal class, read_property() and type == BP_VAR_W
| From: | Marcus Boerger | Date: | Fri, 28 Oct 2005 23:36:40 +0000 |
| Subject: | Re: Internal class, read_property() and type == BP_VAR_W | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-19799@lists.php.net to get a copy of this message | ||
Hello Michael,
actually your class could have another object with get/set handlers
implemented, nothing more. This could be mapped through the handlers
to your int i.
marcus
Friday, October 28, 2005, 10:44:42 PM, you wrote:
> Sara Golemon wrote:
>>> Would you say it's possible that one can maintain i as class
>>> property with write access through references?
>>>
>> Nope, because PHP variables are loose typed.
>>
>> Say you *did* have some way to bind my_obj->i to a userspace variable
>> (e.g.: $i =& $this->i; ). The next instruction could say $i =
>> 'foo';, then what is the engine supposed to do with that?
>>
>> If you want i to have any visibility in userspace, then it needs to
>> be a zval, and that means it can be modified, and that means that
>> you'll need to be prepared to re-cast it back to the right type
>> later. Kinda sucks, but it sucks for a good reason...
> Uhm... you're so right, thanks, that cleared my mind and makes me
> remember my first post to the list ;)
> Thank you,
> --
> Michael - <mike(@)php.net>
> http://dev.iworks.at/ext-http/http-functions.html.gz
Best regards,
Marcus