Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31994 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92764 invoked by uid 1010); 31 Aug 2007 08:23:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92749 invoked from network); 31 Aug 2007 08:23:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2007 08:23:31 -0000 Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:59617] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/33-01254-000D7D64 for ; Fri, 31 Aug 2007 04:23:31 -0400 Received: from dhcp-172-30-11-180.zrh.corp.google.com (unknown [216.239.55.7]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 18D501B35F3; Fri, 31 Aug 2007 10:23:26 +0200 (CEST) Date: Fri, 31 Aug 2007 10:23:25 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1584309005.20070831102325@marcus-boerger.de> To: "Dmitry Stogov" CC: "'Antony Dovgal'" , "'php-dev'" In-Reply-To: <000401c7eb0c$3857edd0$6e02a8c0@thinkpad> References: <46D6BE5F.8060900@zend.com> <000401c7eb0c$3857edd0$6e02a8c0@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods From: helly@php.net (Marcus Boerger) Hello Dmitry, same here. And why not help by forcing to do it in the only correct way? Letting something slip while knowing it will fail anyway just because it doesn kill php is not a good idea - well at least to me. marcus Thursday, August 30, 2007, 3:46:50 PM, you wrote: > I like this patch. It prevents stupid errors. > ZE always passes arguments to magic methods by value so they never may be > modified. > Thanks. Dmitry. >> -----Original Message----- >> From: Antony Dovgal [mailto:antony@zend.com] >> Sent: Thursday, August 30, 2007 4:56 PM >> To: php-dev >> Subject: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods >> >> >> Hello. >> >> I'd like to commit these two patches (for HEAD and 5_2 >> appropriately). The patches disallow declaring any magic >> methods as accepting arguments by ref (which makes no sense anyway). >> >> Example: >> > class test { >> function __set(&$name, $val) { } >> } >> >> $t = new test; >> $name = "prop"; >> $t->$name = 1; >> ?> >> >> Expected result of this code is: >> Fatal error: Method test::__set() cannot take arguments by >> reference in %s on line %d >> >> >> The diffs: >> http://dev.daylessday.org/diff/magic_by_ref_5_2.diff >> http://dev.daylessday.org/diff/magic_by_ref_HEAD.diff >> >> If there are no objections, I'm going to commit them later in >> the evening. >> >> -- >> Wbr, >> Antony Dovgal >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> Best regards, Marcus