Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17522 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48158 invoked by uid 1010); 4 Aug 2005 04:29:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 48143 invoked from network); 4 Aug 2005 04:29:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2005 04:29:57 -0000 X-Host-Fingerprint: 206.190.38.111 web50802.mail.yahoo.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from ([206.190.38.111:31557] helo=web50802.mail.yahoo.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 77/2A-04646-3C991F24 for ; Thu, 04 Aug 2005 00:29:55 -0400 Received: (qmail 64932 invoked by uid 60001); 4 Aug 2005 04:29:51 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=X0s1Yw0vVBPQJjp5PeUrmOgBdNAO4dv8vOO5JTKYpcpA1LLAnqr/gFiR92Av22O4Tkef/ZdJ4qeUsZG/DzRBLckWrEOaCa/Qldvpd+EzgIGZ5tgGVFIZtBXHakyeaDx3kmxCzHc8zBrH+FWAVyBFAWWFiXShp3106rFU/iCjo9U= ; Message-ID: <20050804042951.64930.qmail@web50802.mail.yahoo.com> Received: from [64.231.41.34] by web50802.mail.yahoo.com via HTTP; Wed, 03 Aug 2005 21:29:51 PDT Date: Wed, 3 Aug 2005 21:29:51 -0700 (PDT) To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Re: Property Overloading RFC From: jayboots@yahoo.com (boots) Derick Rethans wrote: > Problems: > 1. There is no way to document the 'virtual' properties with any of > the existing documentation tools (such as phpdoc and doxygen) > 2. There is no way how the magic methods know if a specific 'virtual' > property exists or not as those properties are not declared usually > - unless you define an array with property names as a class > constant (which is not allowed either). > 3. There is no way for the magic methods to return a meaningfull > error when a property doesn't "exist". Of course it is possible to > throw an error with "trigger_error" or "throw" in case a property > doesn't "exist" in a specific class, but the file and line numbers > would not match the actually get/set action. debug_backtrace() can > be used to retrieve the correct file and line, but as you have to > do this for every class where you want to use setters and getters > *and* you have to implement your own error message rendering > function this is not really a suitable option either. As far as introspection (points 1 and 2), would it be reasonable to allow __get/__set to be called without any parameters in which case they would be expected to optionally return an array or object designating the properties that they support? I know that this is somewhat magical but dynamic features are somewhat magical to begin with -- which is part of their charm. FWIW, it would be nice if there was a way for __get/__set to support references. Greetings. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com