Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23978 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68302 invoked by uid 1010); 7 Jun 2006 14:04:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 68287 invoked from network); 7 Jun 2006 14:04:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jun 2006 14:04:46 -0000 X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.21 relay1.ptmail.sapo.pt Linux 2.4/2.6 Received: from ([212.55.154.21:49165] helo=sapo.pt) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 55/10-00946-CFCD6844 for ; Wed, 07 Jun 2006 10:04:45 -0400 Received: (qmail 8780 invoked from network); 7 Jun 2006 14:04:33 -0000 X-Spam-Flag: NO X-Spam-Status: NO (0.0/6.0) (7.28728 seconds) ; checked by PTMail-AS v0.1 on mail.sl.pt X-Spam-Hit: timeout Received: from unknown (HELO sapo.pt) (10.134.35.207) by relay1 with SMTP; 7 Jun 2006 14:04:33 -0000 Received: (qmail 28312 invoked from network); 7 Jun 2006 14:04:34 -0000 X-AntiVirus: PTMail-AV 0.3-0.88.2 X-Virus-Status: Clean (0.01196 seconds) Received: from unknown (HELO pc07653) (nunoplopes@sapo.pt@[82.155.75.222]) (envelope-sender ) by mta12 (qmail-ldap-1.03) with SMTP for ; 7 Jun 2006 14:04:34 -0000 Message-ID: <006501c68a3b$4da96b10$0100a8c0@pc07653> To: , "Ilia Alshanetsky" References: <286CF0DE-43A7-4987-8AE4-97FEE62A1A5A@prohost.org> Date: Wed, 7 Jun 2006 15:04:32 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Subject: Re: [PHP-DEV] Clone Operations From: nlopess@php.net ("Nuno Lopes") I think that "hello" should be printed. Even if the result of clone()ing isn't going to be used, the side-effects should always occur (at least to be consistence). I would bet that other languages would do the same. Nuno ----- Original Message ----- > When it comes to "empty" clone statements, should they be executed and > then free the result (current behavior) or avoid clone all together. > For example when class x { function __clone() { echo "hello"; } } clone > new x(); code is executed, should it print hello or not print anything at > all, treating the clone operation as a NOOP? > > Current behavior calls clone and then frees the result, meaning that > "hello" is printed, but I am uncertain that this is the correct behavior, > any comments? > > Ilia Alshanetsky