Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63705 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40590 invoked from network); 29 Oct 2012 19:14:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Oct 2012 19:14:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.143 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.143 smtp143.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.143] ([67.192.241.143:43718] helo=smtp143.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/90-31721-7A5DE805 for ; Mon, 29 Oct 2012 14:14:50 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp4.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 6A2CC3A064A; Mon, 29 Oct 2012 15:14:44 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp4.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id C3C2B3A0625; Mon, 29 Oct 2012 15:14:43 -0400 (EDT) Message-ID: <508ED5A4.9010100@sugarcrm.com> Date: Mon, 29 Oct 2012 12:14:44 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Clint Priest CC: Pierre Joye , "internals@lists.php.net" References: <508A68B9.1050801@zerocue.com> <508AA48D.5010903@sugarcrm.com> <508C1C4F.6060406@zerocue.com> <508D5726.8080200@zerocue.com> In-Reply-To: <508D5726.8080200@zerocue.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Property Accessors v1.2 : isset / unset "failable" From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > So... to be explicit here, you think in this situation: > > class a { > public $b { > set($x) { $this->b = $x; } > } > } > > $o = new a(); > > if(!isset($o->b)) { > /* delete files */ > } > echo (int)isset($o->b); /* This should return false and not emit any > sort of warning/notice? */ isset should return false, since $b is not set value. It should not produce any warning. Of course (int) would produce 0 then ;) > I mean specifically, there is no getter defined, therefore the result > if isset is indeterminate and while I can see it not causing execution No, the result is determinate - it's false. That's the point of isset() in PHP and that's how it is used in existing code. > to stop I don't see it being a good idea to not warn the developer that > what they've attempted is not correct. Without a getter, isset() is > not a legal call (since the value cannot be retrieved). isset() should always be legal. This is the way to check if $o->b is legal. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227