Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50817 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45823 invoked from network); 2 Dec 2010 14:15:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2010 14:15:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=president@basnetworks.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=president@basnetworks.net; sender-id=unknown; domainkeys=good Received-SPF: error (pb1.pair.com: domain basnetworks.net from 66.33.216.122 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: 66.33.216.122 hapkido.dreamhost.com Linux 2.4/2.6 Received: from [66.33.216.122] ([66.33.216.122:42305] helo=hapkido.dreamhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/E1-36645-31AA7FC4 for ; Thu, 02 Dec 2010 09:15:47 -0500 Received: from homiemail-a76.g.dreamhost.com (caiajhbdcbhh.dreamhost.com [208.97.132.177]) by hapkido.dreamhost.com (Postfix) with ESMTP id 53652179072 for ; Thu, 2 Dec 2010 05:51:04 -0800 (PST) Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id BFB8E45806C; Thu, 2 Dec 2010 05:51:00 -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=NcKuygtFXcj170rZP1Si2jOZZtk02DMs+f/cgiJiGebMH Mdxm0slJAKjn/ZOFqHUxJA+e+yPaJONxX1/OT8HiZWcmmCtTIWdLLuC/tlM1Ff+z 95DqWiC+v3Ev27HCXsqbxny6pbTQ++9HJOiGN/Dkr5ij4Fg29/Z/G7LralBIls= 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=0dZ8c4hoH9rsJQvecBjxSbsuytE=; b=RIvl+NofOS83 SnWMf7fRSeb/B8R2+Gc3A2F623Kx5tA2ADr+Kb5DYGIO7fIIFZrrLfji/Y5kNMSJ IX0dNy+mMko6QJpaq/DuIRgLUFOE+6GlDetfbmVJ+E8UG6Mw6G+10QPF0yxDK0X/ /3RKDFgkQ39g6+5Sizy5FFkbNsYbVBE= Received: from webmail.basnetworks.net (ahfbbjcaiaae.dreamhost.com [75.119.208.4]) (Authenticated sender: president@basnetworks.net) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPA id 6B03245806A; Thu, 2 Dec 2010 05:51:00 -0800 (PST) Received: from 70.28.48.126 (proxying for 70.28.48.126) (SquirrelMail authenticated user president@basnetworks.net) by webmail.basnetworks.net with HTTP; Thu, 2 Dec 2010 08:51:00 -0500 Message-ID: <8b46dd8e3e991cfe87550a9c55d9ecd8.squirrel@webmail.basnetworks.net> In-Reply-To: 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> Date: Thu, 2 Dec 2010 08:51:00 -0500 To: "Eloy Bote Falcon" Cc: rquadling@googlemail.com, "Stas Malyshev" , "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 > 2010/12/1 Richard Quadling > >> On 1 December 2010 09:22, Stas Malyshev wrote= : >> > Hi! >> > >> >> 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 >> > >> > Meant by whom? Is there some law of universe that prevents us from >> > implementing the feature? >> > >> >> of two methods that just have a pretty syntax. Methods cannot be >> unset, >> >> and nor should properties be allowed to. isset() should simply tel= l >> us >> >> whether a property with the specified name is part of the class or >> not. >> > >> > If you need methods, why not use methods? If you mimick object >> properties, >> > however, it makes sense to make them work exactly like property, >> otherwise >> > you have to explain why they don't work this way. >> > >> >> isset() in the way you suggest would just be confusing. It would >> allow >> is >> >> to say that a property does not exist, when in fact it does exist. >> This >> >> is not logical. >> > >> > Sorry, from your answer I don't understand - what happens when you >> call >> > isset($foo->property) and unset($foo->property)? >> >> 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 >> >> 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. >> With regard to unset($instance->property), from the manual ... ... > Why change the expected behavior of isset? If a property has not been s= et > then isset must return false, and that includes $foo->name =3D NULL. Thats simple then, when isset is invoked, call the get method, and if it returns null then isset() returns false, but otherwise returns true. Tha= t was likely just a small oversight on Richard's part. - Dennis