Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31068 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14623 invoked by uid 1010); 18 Jul 2007 20:44:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 14608 invoked from network); 18 Jul 2007 20:44:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2007 20:44:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 63.208.196.171 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 63.208.196.171 outbound.mailhop.org FreeBSD 4.6-4.9 Received: from [63.208.196.171] ([63.208.196.171:3892] helo=outbound.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/61-05349-5BB7E964 for ; Wed, 18 Jul 2007 16:44:39 -0400 Received: from cs136054.pp.htv.fi ([213.243.136.54] helo=[192.168.1.100]) by outbound.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IBGNu-000Js8-Go; Wed, 18 Jul 2007 16:44:34 -0400 X-MHO-User: U2FsdGVkX1+MsVh7sott0IOqsyY3rVPOKgNpJUhSdXM= X-MHO-User: U2FsdGVkX1+Er7nwtFMJuI87aMRz13qlOkAhpiXm8H8= X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 213.243.136.54 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX198CfkSBlI5J5g5PfxqNO9bpaBbPyuPKz8= Message-ID: <469E7BBB.2090303@sci.fi> Date: Wed, 18 Jul 2007 23:44:43 +0300 Reply-To: jani.taskinen@iki.fi User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: Sara Golemon CC: Arnold Daniels , internals@lists.php.net References: <469E765C.2080101@adaniels.nl> <469E7AFC.4060607@php.net> In-Reply-To: <469E7AFC.4060607@php.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: private_write/protected_write properties From: jani.taskinen@sci.fi (Jani Taskinen) So the short answer is: no. End of story. Don't start another endless thread about something that "would be nice" when we have bigger issues on the table that need to be solved before any release, be it alpha/beta/whatever, can be done.. --Jani Sara Golemon kirjoitti: >> I'll probably be lynched for bringing up this subject again, since it >> caused a long discussion a year ago. Anyway I look in the archives and >> there was never a real conclusion made, so I'm bringing it up again. >> This time for a feature I personally would like to see in PHP 6. >> >> Very often I want to be able to be get a property publicly, while only >> being able to set it within the class. You can solve this by using a >> getPropery() method or by using __get($property), but this feels more >> like a workaround. I think the private/public state of properties is >> becoming more important now that using public frameworks is becoming >> main stream. Therefor I believe this would be a good addition. >> > Unfortunately, there are a few caveats to this when used with objects, > resources, and arrays. The simplest way to explain would be to show > some sample code: > > class foo { > public $bar = 'baz'; > } > > class myclass { > protected_write $f; > private_write $fp; > > function __construct() { > $this->f = new foo; > > $this->fp = fopen('somefile.txt', 'r'); > } > } > > $m = new myclass; > > $F = $myclass->f; > $F->bar = 'blong'; > > $FP = $myclass->fp; > fclose($FP); > > > The explanation of arrays is a bit more involved, but it's got some > gotchas too... >