Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50816 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44407 invoked from network); 2 Dec 2010 14:13:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Dec 2010 14:13:34 -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 208.97.132.83 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.83 caiajhbdcaid.dreamhost.com Linux 2.6 Received: from [208.97.132.83] ([208.97.132.83:43767] helo=homiemail-a12.g.dreamhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/91-36645-E89A7FC4 for ; Thu, 02 Dec 2010 09:13:34 -0500 Received: from homiemail-a12.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTP id 9EDEB71408B; Thu, 2 Dec 2010 06:13:31 -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=CNCdOZekCxpLILRe91XpPieKEbc6b2WJqnCqsgf+IZT0n 3OID+aoMiO717wWHofwqu+LyE2K26hddxUxvmgJHpujsASQCB0R+cc4FANmW9pdf mTKDi/ePIFfYJu7Nli5JWtmTDscBIC4Y8B+gGB5nVmPFV7YvOSQ61yM/mqxapo= 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=OR5m4g7rJO16Otey3lEfbNuuWJA=; b=oz15kBf9l8IY 47w7qlfNf+tHVlL2QbRgPx8IvvltJfk7hTJsb9yy85N/oxggbdw4ZCAd4v/biGkz FlDOAnQxWLHHsGyANylQ+ikwsESo27cd+dH5iU9f//D0V4udk7dxKzUV0rAexO8G MFVizMFAUQWhfJGomzo8XZv/BQKICz4= Received: from webmail.basnetworks.net (caiajhbdccac.dreamhost.com [208.97.132.202]) (Authenticated sender: president@basnetworks.net) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTPA id 30E35714088; Thu, 2 Dec 2010 06:13:31 -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 09:13:31 -0500 Message-ID: <7dec3eef8f1763c0245a67c29a4ba369.squirrel@webmail.basnetworks.net> In-Reply-To: <150497B4-DCA3-4042-BE64-6EA6C4C1A0A4@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> <6EC3583E-E7B7-431D-B544-82135A33E351@stefan-marr.de> <150497B4-DCA3-4042-BE64-6EA6C4C1A0A4@stefan-marr.de> Date: Thu, 2 Dec 2010 09:13:31 -0500 To: "Stefan Marr" Cc: "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 Hi Stefan, >> Unfortunately I find that to be one of the major downfalls of PHP. It >> sometimes disregards defacto standards that are set across the entire >> industry, which causes a lot of frustration for new programmers. >> Sometimes the functionality PHP adds by going its own way is worth it, >> but >> often it is just a confusing mess. Thats just my opinion though, YMMV= . > > Still, if it is not consistent in itself it is worse than not following > certain designs which make sense for other languages only. Yes, I would agree with that. >>>> 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. >>> From the docu: isset =97 Determine if a variable is set and is not NU= LL >>> There is nothing confusing about isset($this->Hours) =3D=3D FALSE in = your >>> example if isset($this->seconds) =3D=3D FALSE. >> >> Right, I understand how it would work, and the reasons why it would "m= ake >> sense", but it just feels wrong to me. When you unset() a variable in= a >> class, that whole variable is gone. Its not just hiding somewhere, it= s >> completely gone. If a property were to "pretend" it is not set, with = an >> isset method, it would still be there - just hiding. That is why it >> does not make sense to me. > > The main problem here is that unset and isset are not symmetric. > > isset() basically means there is a value. > Where unset() destroys the _holder_ of the value. > > In that sense, unset is special since it works on another level, on the > same level as property_exists(). > > There are several possible approaches, but the main point here is that = at > least isset() still makes sense. > property_exists() and unset() should be dealt with carefully in another > way. Ok. Well isset() could just run the get handler for the property, and if it is null, return false, and otherwise return true. - Dennis