Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50767 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52603 invoked from network); 1 Dec 2010 10:42:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Dec 2010 10:42:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@stefan-marr.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@stefan-marr.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain stefan-marr.de from 85.88.12.247 cause and error) X-PHP-List-Original-Sender: php@stefan-marr.de X-Host-Fingerprint: 85.88.12.247 toolslave.net Received: from [85.88.12.247] ([85.88.12.247:52824] helo=uhweb12247.united-hoster.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/24-28981-B9626FC4 for ; Wed, 01 Dec 2010 05:42:36 -0500 Received: from soft83.vub.ac.be ([134.184.43.183]) by uhweb12247.united-hoster.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1PNk8q-00024c-1b; Wed, 01 Dec 2010 11:42:30 +0100 Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii In-Reply-To: Date: Wed, 1 Dec 2010 11:42:21 +0100 Cc: Stas Malyshev , "president@basnetworks.net" , "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <9E8F4C11-7C89-4853-AA47-D446214E3F39@stefan-marr.de> References: <003601cb8fd0$f6494e80$e2dbeb80$@com> <4CF3B855.5010406@sugarcrm.com> <003401cb8fee$1be39840$53aac8c0$@com> <2450924ae03481f5b1382a7f00e5743d.squirrel@webmail.basnetworks.net> <4CF50245.5020807@sugarcrm.com> <4CF5118B.2030300@sugarcrm.com> <1faa4c3db62771335db714507ac2adfa.squirrel@webmail.basnetworks.net> <4CF613EB.40200@sugarcrm.com> To: RQuadling@googlemail.com X-Mailer: Apple Mail (2.1082) Subject: Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP From: php@stefan-marr.de (Stefan Marr) Hi Richard: On 01 Dec 2010, at 10:57, Richard Quadling wrote: > If we think of properties as this new entity for the language (rather > than somehow massaging existing entities to fit a new usage scenario), > then >=20 > isset($instance->property) will always return true for any defined > property. Even if the getter would return null. This is new behaviour > and can be easily documented. isset() for a property is more like > method_exists() than isset() on a variable. I tend to see that rather different. Properties are not about methods, properties as in C# are about = abstracting from the actual realization of how the state is represented = internally that is exposed by a property. Thus, properties like proposed here should be used to provide the = illusion of having normal class variables. And in that scenario it makes = sense to talk about the value the property represents and not the fact = that there are methods. So, from my point of view isset/unset have perfectly valid semantics on = many of the usual cases. Even so, I agree, there are cases where that is not so, but in those = cases isset/unset could be specialize like set/get. Best regards Stefan --=20 Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525