Re: Internal class, read_property() and type == BP_VAR_W
| From: | Michael Wallner | Date: | Fri, 28 Oct 2005 20:44:42 +0000 |
| Subject: | Re: Internal class, read_property() and type == BP_VAR_W | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-19798@lists.php.net to get a copy of this message | ||
Sara Golemon wrote:
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.gzWould 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...