Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20205 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21671 invoked by uid 1010); 20 Nov 2005 20:39:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21656 invoked from network); 20 Nov 2005 20:39:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2005 20:39:59 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:60955] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 8E/BC-11378-E1FD0834 for ; Sun, 20 Nov 2005 15:39:59 -0500 Received: from [192.168.1.3] (dslb-084-063-051-138.pools.arcor-ip.net [84.63.51.138]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 04744610282; Sun, 20 Nov 2005 21:45:35 +0100 (CET) Date: Sun, 20 Nov 2005 21:40:06 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <593317031.20051120214006@marcus-boerger.de> To: Bob Silva Cc: 'internals' In-Reply-To: <000001c5edfb$a3d88f20$5d54edc6@jake> References: <000001c5edfb$a3d88f20$5d54edc6@jake> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Help with object creation From: helly@php.net (Marcus Boerger) Hello Bob, in php 4 that prevents a useless copy after new (and dont't ask why). Since your stuff is php 5 only you should make that is_ref=0. marcus Sunday, November 20, 2005, 6:55:49 PM, you wrote: > Looking through the source, there are a few extensions which create objects > internally and when they do this (usually with an instanciate method), they > typically set is_ref == 1. Like so: > > object_init_ex(object, class_entry); > object->refcount = 1; > object->is_ref = 1; > > > Why set the is_ref? Aren't objects treated as is_ref natively throughout the > engine? Or is this just old code from PHP 4 days that is still hanging > around? > > Thanks for the understanding. > > Bob Silva > Best regards, Marcus