> Hm... maybe I made not a good start with my question, let me ty again,
please:
>
> typedef struct {
> zend_object zo;
> int i;
> } my_obj;
>
> 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...

-Sara

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to