Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31086 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76265 invoked by uid 1010); 19 Jul 2007 08:24:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 76244 invoked from network); 19 Jul 2007 08:24:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2007 08:24:09 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 72.14.246.242 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 72.14.246.242 ag-out-0708.google.com Received: from [72.14.246.242] ([72.14.246.242:1149] helo=ag-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/A0-02341-C5F1F964 for ; Thu, 19 Jul 2007 04:22:53 -0400 Received: by ag-out-0708.google.com with SMTP id 31so565883agc for ; Thu, 19 Jul 2007 01:22:48 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DOq7b6oYfzMJq32p1WP9qIZnNPIf90XOE5bbqJWBlCiTqUkGzcbAtw2gLLZuQQrKnXuMRdQ6mggIpTxiXxI0evH+xXFngJxhgJQRlaRZYMIjovlSOmn41gZgMTQwVCVaX1QNdJtSMam6KWurqF0N9MYs9ira20/qv/EptpNVoq8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XKgSSpwqfhgrGKdUdemsoYVbSutkbcmRg9R2gPLCnrBFjbwoyH+3mFxHK2NCigUSrTbz3mMkv9gYXaG4O+UCPf7vIwWCEb/2xNwyAtOOh+xRiy5QNX8e48dfC8a+kBoC5Z94Iyr6LwPSmhvSQHUULeIgnLXl2BVVZodk+0PEhPQ= Received: by 10.114.254.1 with SMTP id b1mr2333311wai.1184833368328; Thu, 19 Jul 2007 01:22:48 -0700 (PDT) Received: by 10.115.74.10 with HTTP; Thu, 19 Jul 2007 01:22:48 -0700 (PDT) Message-ID: <10845a340707190122n7897758cp7d1c7acd420ac352@mail.gmail.com> Date: Thu, 19 Jul 2007 09:22:48 +0100 Reply-To: RQuadling@GoogleMail.com To: jani.taskinen@iki.fi Cc: "Sara Golemon" , "Arnold Daniels" , internals@lists.php.net In-Reply-To: <469E7BBB.2090303@sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <469E765C.2080101@adaniels.nl> <469E7AFC.4060607@php.net> <469E7BBB.2090303@sci.fi> Subject: Re: [PHP-DEV] Re: private_write/protected_write properties From: rquadling@googlemail.com ("Richard Quadling") On 18/07/07, Jani Taskinen wrote: > 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... > > Has anyone got a list of WIBNI's and their status (already done, definitely going in, under discussion, not enough info, no chance) sort of thing? -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"