Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21184 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58902 invoked by uid 1010); 12 Dec 2005 07:36:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58887 invoked from network); 12 Dec 2005 07:36:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2005 07:36:26 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:37583] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6B/5A-49905-A782D934 for ; Mon, 12 Dec 2005 02:36:26 -0500 Received: from [192.168.1.3] (dslb-084-063-008-178.pools.arcor-ip.net [84.63.8.178]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 5CB5A610287; Mon, 12 Dec 2005 08:43:43 +0100 (CET) Date: Mon, 12 Dec 2005 08:33:57 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <145371278.20051212083357@marcus-boerger.de> To: Superbiji Cc: internals@lists.php.net In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] __set and reference From: helly@php.net (Marcus Boerger) Hello Superbiji, Monday, December 12, 2005, 4:49:06 AM, you wrote: > Hi All, > in prior 5.1, it is allowed to do: > class MyClass { > public function __set($key, &$value) {} > } > $c = new MyClass(); > $c->d=10; > in 5.1 up: > that code result this: > Fatal error: Couldn't execute method MyClass::__set in Unknown on line 0 > I have submit this bug. > My question is, is it possible to assign as reference using setter method ? So here the answer in slightly more words: No, you have to keep the signature of __set() thus you cannot assign references using __set(). This was an error we fixed with 5.1.0. Best regards, Marcus