Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23520 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99306 invoked by uid 1010); 17 May 2006 09:00:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99291 invoked from network); 17 May 2006 09:00:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 May 2006 09:00:46 -0000 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:15867] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 33/20-19568-D36EA644 for ; Wed, 17 May 2006 05:00:46 -0400 Received: (qmail 20376 invoked from network); 17 May 2006 09:00:32 -0000 Received: from shire.zend.office (10.1.2.160) by internal.zend.office with SMTP; 17 May 2006 09:00:32 -0000 Date: Wed, 17 May 2006 12:00:32 +0300 (IDT) X-X-Sender: frodo@shire.zend.office To: Andi Gutmans cc: PHP internals In-Reply-To: <7.0.1.0.2.20060516142654.02c78380@zend.com> Message-ID: References: <785810036.20060511193536@ionzoft.com> <44647B7A.2070301@php.net> <932738738.20060513112734@marcus-boerger.de> <837405862.20060513223403@ionzoft.com> <36828701.20060514110529@marcus-boerger.de> <31269879.20060514221212@marcus-boerger.de> <1327845846.20060514222154@marcus-boerger.de> <1562034641.20060516203354@marcus-boerger.de> <7.0.1.0.2.20060516235201.090f10a8@zend.com> <7.0.1.0.2.20060516142654.02c78380@zend.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] private, protected, readonly, public From: stas@zend.com (Stanislav Malyshev) AG>>Probably because private variables do often have getters and setters, AG>>whereas something which is marked as read-only (like a harddrive) AG>>tends to be read-only always. I think that by itself returning writable reference to such variable voluntarily is undesirable, but not fatal - i.e., in most cases the advice would be "just don't do it" but if you think you know what you are doing, you may do it. What I'm concerned about, however - and that is somehow related to what Andi is saying I think - is that this concept would not sit well with PHP semantics. The thing here is that PHP has some cases where writable zval reference is taken without really knowing how it would be used. And in these cases we might find out we actually have no good way to insert the check. I remember we had to do various tricks to make get/set handlers work in all cases where writable zval is required and I'm not sure there's no bordercases even now when it doesn't do exactly what one might expect it to do - but we might get a lot of additional problems when we add non-trivial semantics like denying writes on top of this. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115