Re: Referencing constants in extension code

From: Date: Fri, 18 Jan 2008 07:33:34 +0000
Subject: Re: Referencing constants in extension code
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-34826@lists.php.net to get a copy of this message
On 1/18/08, Antony Dovgal <tony@daylessday.org> wrote: > On 18.01.2008 04:39, Michael B Allen wrote: > >> You have to copy the string if you want to store it. > > > > Ok. Doesn't look like I have much choice. I just wanted to understand > > the problem better. I'll just copy the strings. > > > > But it does seem odd to me that PHP does not always reference string > > constants directly. I mean, why copy if you don't have to? > > Because you have to copy something that is going to be freed by PHP. > That's how it works & worked for ages - you don't have to free the > strings you get from zend_parse_parameters() because PHP does it for you. I newer versions of zend engine are more aggressive about collecting that memory and now it's caught up with me. I have changed my code to make a copy and all seems to be working well again. Thanks, Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/

« previous php.internals (#34826) next »