get_property_ptr_ptr handler

php.internals

Andrei Zmievski

21 years ago
Could someone knowledgeable please remind me again: in what exact circumstances is overriding get_property_ptr_ptr useful vs. leaving it NULL? - Andrei

Andi Gutmans

21 years ago
In general it's not useful. It exists so that regular PHP objects can be optimized to use zval ** and not read/write property callbacks. This is faster for example if you're doing increment. However, in most cases of writing extensions I suggest read/write property unless you are just wrapping zval *'s. Andi At 02:33 PM 1/27/2005 -0800, Andrei Zmievski wrote:

Andrei Zmievski

21 years ago
On Thu, 27 Jan 2005, Andi Gutmans wrote:
> In general it's not useful. It exists so that regular PHP objects can be > optimized to use zval ** and not read/write property callbacks. This is > faster for example if you're doing increment. However, in most cases of > writing extensions I suggest read/write property unless you are just > wrapping zval *'s.
If passing those properties by reference to functions works, perfect. I'll NULL it out then. - Andrei

Andi Gutmans

21 years ago
At 03:53 PM 1/27/2005 -0800, Andrei Zmievski wrote:
>On Thu, 27 Jan 2005, Andi Gutmans wrote: > > In general it's not useful. It exists so that regular PHP objects can be > > optimized to use zval ** and not read/write property callbacks. This is > > faster for example if you're doing increment. However, in most cases of > > writing extensions I suggest read/write property unless you are just > > wrapping zval *'s. > >If passing those properties by reference to functions works, perfect. >I'll NULL it out then.
I'm not sure what you mean by passing by reference. If you want to do real by reference work then you have to use object proxies and ->set() ->get() callbacks. In general, the semantics of by reference is mainly designed for regular PHP objects and zval **'s (i.e. PHP values). Andi

Andrei Zmievski

21 years ago
On Thu, 27 Jan 2005, Andi Gutmans wrote:
> I'm not sure what you mean by passing by reference. If you want to do real > by reference work then you have to use object proxies and ->set() ->get() > callbacks. In general, the semantics of by reference is mainly designed for > regular PHP objects and zval **'s (i.e. PHP values).
I tried passing my property to a function that accepts parameter by reference, and the modifying it inside the function. The value was changed on the outside as well. - Andrei