Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31985 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53845 invoked by uid 1010); 30 Aug 2007 13:46:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53829 invoked from network); 30 Aug 2007 13:46:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2007 13:46:55 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:9615] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/42-35128-D4AC6D64 for ; Thu, 30 Aug 2007 09:46:55 -0400 Received: (qmail 14363 invoked from network); 30 Aug 2007 13:46:50 -0000 Received: from internal.zend.office (HELO thinkpad) (10.1.1.1) by internal.zend.office with SMTP; 30 Aug 2007 13:46:50 -0000 To: "'Antony Dovgal'" , "'php-dev'" Date: Thu, 30 Aug 2007 17:46:50 +0400 Message-ID: <000401c7eb0c$3857edd0$6e02a8c0@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-Reply-To: <46D6BE5F.8060900@zend.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Subject: RE: [PHP-DEV] [PATCH] disallow arguments by ref in magic methods From: dmitry@zend.com ("Dmitry Stogov") References: <46D6BE5F.8060900@zend.com> 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 >