Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17343 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2112 invoked by uid 1010); 20 Jul 2005 12:08:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2097 invoked from network); 20 Jul 2005 12:08:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2005 12:08:41 -0000 X-Host-Fingerprint: 82.94.239.5 jdi.jdi-ict.nl Linux 2.5 (sometimes 2.4) (4) Received: from ([82.94.239.5:36477] helo=jdi.jdi-ict.nl) by pb1.pair.com (ecelerity 2.0 beta r(6227M)) with SMTP id CF/E7-61486-8CE3ED24 for ; Wed, 20 Jul 2005 08:08:41 -0400 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j6KC8cb3004918 for ; Wed, 20 Jul 2005 14:08:38 +0200 Received: from localhost (localhost [127.0.0.1]) by jdi.jdi-ict.nl (8.12.11/8.12.11) with ESMTP id j6KC8JVj004900; Wed, 20 Jul 2005 14:08:19 +0200 Date: Wed, 20 Jul 2005 14:08:18 +0200 (CEST) X-X-Sender: derick@localhost To: Andrey Nikolaev cc: internals@lists.php.net In-Reply-To: Message-ID: References: <1121626339.23752.24.camel@blobule.suds> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at jdi-ict.nl Subject: Re: [PHP-DEV] Re: Reference Notice From: derick@php.net (Derick Rethans) On Wed, 20 Jul 2005, Andrey Nikolaev wrote: > function &a() { > if(1==2) > return new B; //some reference... > else > return null; //error, we cant create B > } > $b_instance = a(); > ?> Why are you returning by reference in the first place here? "new B" already creates a copy. Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org