Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25669 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22621 invoked by uid 1010); 13 Sep 2006 18:05:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22606 invoked from network); 13 Sep 2006 18:05:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Sep 2006 18:05:38 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 80.74.107.235 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [80.74.107.235] ([80.74.107.235:11658] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/25-25108-A4848054 for ; Wed, 13 Sep 2006 14:05:38 -0400 Received: (qmail 18793 invoked from network); 13 Sep 2006 18:03:40 -0000 Received: from localhost (HELO ?127.0.0.1?) (127.0.0.1) by localhost with SMTP; 13 Sep 2006 18:03:40 -0000 Message-ID: <4508483D.8070504@zend.com> Date: Wed, 13 Sep 2006 11:04:45 -0700 Organization: Zend Technologies User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Terje_Sletteb=F8?= CC: internals@lists.php.net References: <0ca501c6d709$0cc74020$a900000a@adstate.local> In-Reply-To: <0ca501c6d709$0cc74020$a900000a@adstate.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Const member functions From: stas@zend.com (Stanislav Malyshev) > In C++, it's possible to declare member functions "const" meaning they don't > change the object they operate on. This can help reason about programs, > because if you have something like (PHP syntax): It would be pretty hard to enforce in PHP - how do you know the object is not changed, without strictly typing all the functions that access it? Also, while in C++ compiler can benefit from knowing the function is const - i.e. from knowing nothing was changed by it regarding this argument - PHP engine hardly can do it.