Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63698 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77084 invoked from network); 29 Oct 2012 01:57:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Oct 2012 01:57:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=davidkmuir@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=davidkmuir@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.42 as permitted sender) X-PHP-List-Original-Sender: davidkmuir@gmail.com X-Host-Fingerprint: 209.85.210.42 mail-da0-f42.google.com Received: from [209.85.210.42] ([209.85.210.42:51828] helo=mail-da0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/11-65462-282ED805 for ; Sun, 28 Oct 2012 20:57:22 -0500 Received: by mail-da0-f42.google.com with SMTP id z17so2113281dal.29 for ; Sun, 28 Oct 2012 18:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=iHw2H8yVMoLGFYtl3+AbENSY0caAiFofxGXP0H27pVQ=; b=mMhbWZRsX8J1Vcg7JYCVK73sTfiqsbRU2HvwsEJj1sqeglDSrKQOSQGvAR8dWLftU7 Bgmtyy3gTn60bUuOvXS/SmBgcf9z3JN2slZ9/a2zb2QMWa0AY9SANTP3wp1YkNlazpry NL9yqE79UAdVPfdJyMxwtmLMFjcraxyFylTNqeQFRmDRtQWx3FZQQls+qp19qcKQX2QD 2sBm9cu3e1VxAIogyYzJABV1+sDmtdnzxzI/mZwhR9JGXL/9RibbJsXNRqMapKMK+OeK Q7/wWMf5W0ZWn4QT7tB9bcDwLzFEFq34dSXJc35HO8BQR/CxnOxVh/NG5LgMBIeDvgkX t2Cw== Received: by 10.66.87.163 with SMTP id az3mr79391928pab.62.1351475839436; Sun, 28 Oct 2012 18:57:19 -0700 (PDT) Received: from [192.168.1.181] (tmwpho1.lnk.telstra.net. [110.142.207.74]) by mx.google.com with ESMTPS id ms11sm5097905pbc.74.2012.10.28.18.57.15 (version=SSLv3 cipher=OTHER); Sun, 28 Oct 2012 18:57:18 -0700 (PDT) Message-ID: <508DE27C.4040007@gmail.com> Date: Mon, 29 Oct 2012 12:57:16 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 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; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Property Accessors v1.2 : isset / unset "failable" From: davidkmuir@gmail.com (David Muir) On 29/10/12 03:02, Clint Priest wrote: > 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? */ > > I mean specifically, there is no getter defined, therefore the result > if isset is indeterminate and while I can see it not causing execution > 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). > I agree with Pierre, isset() should never throw a warning/notice. The primary use of isset (that I've seen in various code-bases) is to avoid warnings/notices. Only rarely do I see it used in an expression to control application logic. The above example should not give a warning, and should return false. As far as an application is concerned, $o->b doesn't exist because it can't be read. David