Re: Ref count compatibility with PHP < 5.3
| From: | Johannes Schlüter | Date: | Sun, 02 Jan 2011 19:53:58 +0000 |
| Subject: | Re: Ref count compatibility with PHP < 5.3 | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-7899@lists.php.net to get a copy of this message | ||
On Tue, 2010-12-28 at 12:32 -0800, Pieter de Zwart wrote:
> John Skopis just sent me a patch for the AMQP extension for
> compatibility with PHP < 5.3. The patch is attached.
>
> In the AMQP codebase, I am using Z_ADDREF_P. Is this the wrong way to
> handle ref counts? Or is the attached patch the standard way of
> handling BC for newer extensions?
Your patch didn't come through. In general a way to handle this is
something like
#if PHP_VERSION_ID < 50300
#define Z_ADDREF_P(z) ((z)->refcount++)
#endif
johannes