Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50747 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65276 invoked from network); 1 Dec 2010 00:29:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Dec 2010 00:29:09 -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.119 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.119 caiajhbdcbbj.dreamhost.com Linux 2.6 Received: from [208.97.132.119] ([208.97.132.119:41114] helo=homiemail-a15.g.dreamhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FB/F1-53511-4D695FC4 for ; Tue, 30 Nov 2010 19:29:09 -0500 Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id BD50676C069; Tue, 30 Nov 2010 16:29:05 -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=1XTcn2ugK9TIbTkF4unJhQk04tFqT9qhL5XrVCqGJY2hv YO0Mr0OBHt3NNX9cK43Aw9/4mVOIcLA0yJGM5qQvYBZKNswqUyClQOn1IwYzY/4x qzoaFqh+qWiSSF27ISzCM60zJRqDNtJdGo1BceF7q8X7CQIQYb8QFGfxxJPsGY= 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=7ZcDTX6kTrpBTN69iVKTQdRmQIQ=; b=IsXKT7ikXNv2 XGHYcN5wOqJielX43Qd6xEfVOtf3uYFDqSLoFtiRjyqUpnXY7c+hdPhCrmIFq0i8 GDWuoxElI8rEkS/zZMc2MeAYAPvpNbcj4oW7bOuNBydKNZo8uZsDZunIujck4wb2 YOfsCik+1jgBNsIwlR+UZYBqEr6yN5w= Received: from webmail.basnetworks.net (caiajhbdcbbj.dreamhost.com [208.97.132.119]) (Authenticated sender: president@basnetworks.net) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPA id 7A11276C058; Tue, 30 Nov 2010 16:29:05 -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:29:05 -0500 Message-ID: <89020a2f897b85939c929ec28892158d.squirrel@webmail.basnetworks.net> In-Reply-To: <1291127695.6129.16.camel@guybrush> References: <003601cb8fd0$f6494e80$e2dbeb80$@com> <4CF3B855.5010406@sugarcrm.com> <003401cb8fee$1be39840$53aac8c0$@com> <2450924ae03481f5b1382a7f00e5743d.squirrel@webmail.basnetworks.net> <4CF50245.5020807@sugarcrm.com> <1291127695.6129.16.camel@guybrush> Date: Tue, 30 Nov 2010 19:29:05 -0500 To: =?iso-8859-1?Q?=22Johannes_Schl=FCter=22?= Cc: president@basnetworks.net, "Stas Malyshev" , 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. >> >> Because properties (as defined in my RFC) are not a variable, but rath= er >> a >> set of methods, I do not think there would be any way to "unset" them. >> Like a method, once they are defined, you cannot get rid of them. >> Therefore "overloading" isset and unset would not make any sense here. > > This is different from the PHP Language then. You can isset() and > unset() "native" properties. And use __isset() and __unset() magic > methods. > > A new feature should be consistent with the language definition. 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 either exists or does not exist. This is because __isset 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