Re: [PECL-DEV] Re: shared memory extention
[email protected] ("Gustavo Lopes") Thu, 15 Apr 2010 20:43:22 +0200
| Newsgroups | php.pecl.dev |
|---|---|
| Organization | NĂșcleo de Eng. BiomĂ©di ca do IST |
| Message-ID | <[email protected]> |
On Thu, 15 Apr 2010 17:44:05 +0200, Geoffrey McRae <[email protected]> wrote: > Thanks for the help, > > I have another question, hopefully simple... > how do I get the parent zval of a zval that has is_ref set to true? > > I have 99% of the code functional now, just need to figure out this > array reference issue. > > Or even better yet, is there a way to compare two zval's and see if they > are pointing to the the same data? > is_ref only says if a zval is part of a reference set; there is no parent. If you make $a = 1; $b =& $a; there will be only one zval (with is_ref set to TRUE and refcount set to 2). With is_ref set to TRUE, you know, for instance, you don't have to separate $a and $b when you change one of them (since if you omitted "&" there would still be only one zval). -- Gustavo Lopes