Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34882 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97505 invoked by uid 1010); 23 Jan 2008 03:01:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 97490 invoked from network); 23 Jan 2008 03:01:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2008 03:01:46 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain l-i-e.com from 67.139.134.202 cause and error) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:2130] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/C0-25953-91EA6974 for ; Tue, 22 Jan 2008 22:01:45 -0500 Received: (qmail 14001 invoked by uid 98); 23 Jan 2008 03:01:56 -0000 Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-2.01 (clamdscan: 0.88.7/5519. Clear:RC:1(127.0.0.1):. Processed in 0.136985 secs); 23 Jan 2008 03:01:56 -0000 Received: from localhost (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 23 Jan 2008 03:01:56 -0000 Received: from 98.193.37.55 (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Tue, 22 Jan 2008 21:01:56 -0600 (CST) Message-ID: <44308.98.193.37.55.1201057316.squirrel@www.l-i-e.com> In-Reply-To: <47905069.7050004@daylessday.org> References: <78c6bd860801171233p6f652d3bl54559d51963c1300@mail.gmail.com> <478FC8E4.3050104@daylessday.org> <78c6bd860801171739o3e746302v449afd6f62eaa30b@mail.gmail.com> <47905069.7050004@daylessday.org> Date: Tue, 22 Jan 2008 21:01:56 -0600 (CST) To: "Michael B Allen" Cc: internals@lists.php.net Reply-To: ceo@l-i-e.com User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] Referencing constants in extension code From: ceo@l-i-e.com ("Richard Lynch") On Fri, January 18, 2008 1:08 am, Antony Dovgal 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. Or, to put it another way, as I understand it: You know that 0|1 flag you can use when you return a value? That flag isn't about whether or not PHP will nuke the value when it exits; PHP is *GOING* to nuke that value. The flag is about whether PHP should copy it for you, so it can nuke its own copy, or if you've already made it a PHP value/copy, which PHP can safely nuke. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So?