Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50773 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70202 invoked from network); 1 Dec 2010 12:40:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Dec 2010 12:40:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:49143] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/71-62427-A3246FC4 for ; Wed, 01 Dec 2010 07:40:27 -0500 Received: by vws11 with SMTP id 11so2399271vws.29 for ; Wed, 01 Dec 2010 04:40:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:reply-to :in-reply-to:references:from:date:message-id:subject:to:cc :content-type; bh=t7H8RkIXUIWzOQQxDH3fmqz5aWENLhr98wcqUmmNivc=; b=Ma9T+MjKRrrvNKqGzYm9Z1lv997D8wOzjytYKP5eLoJm/WCnhAhqHA616L8baCeTqU XV43EXnOWxeph15Hm0HI0Zk1c/bh+uvxZlSApjJ6LoPl0lt/nhJXL9KHkRxjHbh0+MA8 1c+PQ4ivHtU/aG3getK7xuxoKC34Yh6OiHRBk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; b=CV8aZxWaOSEJm9t1e/yWAdeC3i0jwsEBRBkoujIkGe3y4YPaarOds1n42mYKJC9AZF NQxYTiCpv/ecZex+u5FvmB0uLEA6O94rclzBABrhS8kLlXZJ2RAntx3SeyPgwy+KEfAW GB5BEEojvSaRd7wuLRqRly1YTUkQzaPnWMp+w= Received: by 10.229.95.211 with SMTP id e19mr7351102qcn.139.1291207224024; Wed, 01 Dec 2010 04:40:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.100.130 with HTTP; Wed, 1 Dec 2010 04:40:03 -0800 (PST) Reply-To: RQuadling@googlemail.com In-Reply-To: <4CF64000.7030600@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> <1faa4c3db62771335db714507ac2adfa.squirrel@webmail.basnetworks.net> <4CF613EB.40200@sugarcrm.com> <4CF625C2.1080606@sugarcrm.com> <4CF64000.7030600@sugarcrm.com> Date: Wed, 1 Dec 2010 12:40:03 +0000 Message-ID: To: Stas Malyshev Cc: "president@basnetworks.net" , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] RFC: C-sharp style property get/set syntax for PHP From: rquadling@gmail.com (Richard Quadling) On 1 December 2010 12:30, Stas Malyshev wrote: > Hi! > >> No. The prototype of all setters would be the same. As would the >> prototype of all getters. > > But we'd have two sets of properties - one handled by __get/__isset, another > - by get($isset). Not a good idea. So, should properties isset/unset go via the magic methods? With properties, there would be the duplication anyway (__get()/get() and __set()/set()). Either way, only the property knows what should happen when an isset() or unset() is called against it. It is for that reason that I think the property should handle it. __get, __set, __isset and __unset are for undefined class members. Not properties. From the user of the class, completely invisible. Having more than 1 way to skin the cat is pretty much de rigueur for PHP. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY