Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23389 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50498 invoked by uid 1010); 15 May 2006 18:01:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 50483 invoked from network); 15 May 2006 18:01:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2006 18:01:17 -0000 X-PHP-List-Original-Sender: zeev@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:43305] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 79/F5-19568-BE1C8644 for ; Mon, 15 May 2006 14:01:16 -0400 Received: (qmail 32461 invoked from network); 15 May 2006 18:01:04 -0000 Received: from localhost (HELO zeev-notebook.zend.com) (127.0.0.1) by localhost with SMTP; 15 May 2006 18:01:04 -0000 Message-ID: <7.0.1.0.2.20060515205946.08931ec0@zend.com> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Mon, 15 May 2006 21:00:52 +0300 To: Jason Garber Cc: internals@lists.php.net In-Reply-To: <7.0.1.0.2.20060515205617.08191b00@zend.com> References: <785810036.20060511193536@ionzoft.com> <7.0.1.0.2.20060512082920.040b4040@zend.com> <7.0.1.0.2.20060515205617.08191b00@zend.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] private, protected, readonly, public From: zeev@zend.com (Zeev Suraski) Strike that, I was smoking something strong :) Class constants are not really relevant for this use case. At 20:57 15/05/2006, Zeev Suraski wrote: >I agree with Andi on that (surprise surprise :) > >What does that give you that class constants don't? > >Zeev > > >At 18:34 12/05/2006, Andi Gutmans wrote: >>I can see where it could come in handy but I honestly think it'd be bloat. >>We have to relax with the OO features because the increased code >>size has already made it harder to maintain and it has the >>potential to make PHP far more complicated than what it should be. >> >>At 04:35 PM 5/11/2006, Jason Garber wrote: >>>Hello internals, >>> >>> __get() and __set() are great, but 90% of the time, I find myself >>> using them to create public readonly properties. >>> >>> The only problem with this is it is horridly inefficient, consuming >>> at least 1 function call and one switch statement (or equiv) per >>> property read. >>> >>> Would it be possible to create a new object property attribute: >>> readonly >>> >>> class xx >>> { >>> readonly $bar; >>> } >>> >>> $o = new xx(); >>> >>> $o->bar = 10; >>> >>> FATAL ERROR >>> >>> >>> This way, PHP would allow reading (as if it were public), but only >>> allow writing from within the class. >>> >>> I think it could really boost performance of complicated application >>> logic that wishes to enforce good visibility. >>> >>> Comments? >>> >>> PS. What brought this up was some serious performance issues in a >>> piece of code that I am working with - most of which can be tied >>> back to __get() performance. >>> >>>-- >>>Best regards, >>> Jason Garber mailto:jason@ionzoft.com >>> IonZoft, Inc. >>> >>>-- >>>PHP Internals - PHP Runtime Development Mailing List >>>To unsubscribe, visit: http://www.php.net/unsub.php >> >>-- >>PHP Internals - PHP Runtime Development Mailing List >>To unsubscribe, visit: http://www.php.net/unsub.php > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php