Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50749 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66649 invoked from network); 1 Dec 2010 00:31:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Dec 2010 00:31:52 -0000 Authentication-Results: pb1.pair.com header.from=president@basnetworks.net; sender-id=unknown; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=president@basnetworks.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basnetworks.net from 208.97.132.145 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: president@basnetworks.net X-Host-Fingerprint: 208.97.132.145 caiajhbdcbef.dreamhost.com Linux 2.6 Received: from [208.97.132.145] ([208.97.132.145:37296] helo=homiemail-a22.g.dreamhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/42-53511-67795FC4 for ; Tue, 30 Nov 2010 19:31:51 -0500 Received: from homiemail-a22.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a22.g.dreamhost.com (Postfix) with ESMTP id 1C05C1A8076; Tue, 30 Nov 2010 16:31:22 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=basnetworks.net; h=message-id :in-reply-to:references:date:subject:from:to:cc:mime-version :content-type:content-transfer-encoding; q=dns; s= basnetworks.net; b=0vZbgg8iurHL5jJIgM1n36pDlr6ihacGMhPooeIcLMAIJ MeZx6Upd53qlZstkhCODjS8LQeRQfWaNySUW3oqWKODXB22HNi+ipp56dbfEPdcm 6BW14UdTTyts5bXaiaRj/U8aWrSU2Ksq2/SbTmQyu0ZUkUoWsGLM8KlsowYDr0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=basnetworks.net; h= message-id:in-reply-to:references:date:subject:from:to:cc :mime-version:content-type:content-transfer-encoding; s= basnetworks.net; bh=n1qpDxXekRhEfezI7V57CAVXgXE=; b=jHn896yCceut 0HCn1mkGqGUsi01GsMQyyOs3hcBwoolQlRFfMRTeUlCApvGnDNEauPGs4JTW24kS pQllA5vWW50V03k4ZDn4k3xKZD7nJXmYwCNZL33d9NquQrAYbxvwlFhHRwkUI12F pfPzbYDSgoFwAq/emoR5lkArsrroQTI= Received: from webmail.basnetworks.net (caiajhbdcbef.dreamhost.com [208.97.132.145]) (Authenticated sender: president@basnetworks.net) by homiemail-a22.g.dreamhost.com (Postfix) with ESMTPA id 9E9B31A8058; Tue, 30 Nov 2010 16:31:21 -0800 (PST) Received: from 69.165.140.136 (proxying for 69.165.140.136) (SquirrelMail authenticated user president@basnetworks.net) by webmail.basnetworks.net with HTTP; Tue, 30 Nov 2010 19:31:22 -0500 Message-ID: <1faa4c3db62771335db714507ac2adfa.squirrel@webmail.basnetworks.net> In-Reply-To: <4CF5118B.2030300@sugarcrm.com> 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> Date: Tue, 30 Nov 2010 19:31:22 -0500 To: "Stas Malyshev" Cc: "president@basnetworks.net" , "internals@lists.php.net" User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP From: president@basnetworks.net >> That is true for PHP variables. isset is basically saying "does this >> variable exist", and unset is saying to get rid of it. > > This is also true for object properties - see magic methods. I don't se= e > why you shouldn't be able to unset them - you can do that with regular > properties... So what you imagine would happen if you call > unset($foo->property) or isset($foo->property)? As I replied elsewhere: Its not a matter of consistency - Properties, as a cross-language concept are not meant to work that way. You need to think of a property as a set of two methods that just have a pretty syntax. Methods cannot be unset, and nor should properties be allowed to. isset() should simply tell us whether a property with the specified name is part of the class or not. isset() in the way you suggest would just be confusing. It would allow i= s to say that a property does not exist, when in fact it does exist. This is not logical. __isset is a whole different matter, without it we would have to assume that every possible member name in a class either exists or does not exist. This is because __isset, __get, __set and __unset can handle ANY member name. Properties are bound to a single member name, therefore, they always exist, unless you were to physically remove that property from the class, which, like methods, that is not possible. - Dennis