Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17506 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21695 invoked by uid 1010); 2 Aug 2005 21:17:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21679 invoked from network); 2 Aug 2005 21:17:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Aug 2005 21:17:04 -0000 X-Host-Fingerprint: 209.151.233.33 unknown Linux 2.4/2.6 Received: from ([209.151.233.33:41387] helo=mail.safesearching.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6D/7B-04646-FC2EFE24 for ; Tue, 02 Aug 2005 17:17:04 -0400 Received: (qmail 673 invoked from network); 2 Aug 2005 21:35:15 -0000 Received: from adsl-67-112-238-195.dsl.lsan03.pacbell.net (HELO ?192.168.1.136?) (james@safesearching.com@67.112.238.195) by mail.safesearching.com with RC4-MD5 encrypted SMTP; 2 Aug 2005 21:35:15 -0000 Message-ID: <42EFE41F.9040400@safesearching.com> Date: Tue, 02 Aug 2005 14:22:39 -0700 User-Agent: Mozilla Thunderbird 1.0+ (Windows/20050531) MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Property Overloading RFC From: james@safesearching.com (James Crumpton) My concern with the self::isVirtual() syntax would be... class Base { function __get($name) { if (!self::isVirtual($name)) throw; } } class Foo { abstract public $bar = 1; } $f = new Foo; echo $f->bar; ... Are these 'virtual' members going to work like static members, in that using self:: in a base class doesn't allow access to those static members of inheriting classes? ie, will the above example throw an error or not, like it would if a similar thing with statics were to try and be done. Derick Rethans wrote: > This is ofcourse overly complicated. A better workable solution would be - > without breaking BC (suggestions for syntax here are very welcome): > > class Base > { > abstract public $x = 1; > > function __get($name) > { > if (!self::isVirtual($name))) { > /* throw error */ > } > } > } > > $b = new Base(); > echo $b->foo; > ?>