Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88183 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41958 invoked from network); 14 Sep 2015 15:57:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Sep 2015 15:57:53 -0000 Authentication-Results: pb1.pair.com header.from=craig@craigfrancis.co.uk; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=craig@craigfrancis.co.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain craigfrancis.co.uk designates 209.85.212.175 as permitted sender) X-PHP-List-Original-Sender: craig@craigfrancis.co.uk X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:38560] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D1/01-30633-E7EE6F55 for ; Mon, 14 Sep 2015 11:57:51 -0400 Received: by wiclk2 with SMTP id lk2so139267888wic.1 for ; Mon, 14 Sep 2015 08:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=craigfrancis.co.uk; s=default; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eA/ODyvNEVOX3ch+jdWT6VLZEgDi7C9tESQS+tWXJsc=; b=Ri+jMSNqfDl9BOJEjkN3c1ZtMiFywGQ1D5G6tNLOzz6B5gsPLmKOm1+NFVTfYmDvDQ dkP7WzWfs2Kt3wxF9NK4jQcaMlh6Pq57R+ph9sXo+wBb8TxN5112ZNwoS97pSPZOQuod MCFJVFGUzYlWM0Lri4r2KS6LB1OkpXEyKEu30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=eA/ODyvNEVOX3ch+jdWT6VLZEgDi7C9tESQS+tWXJsc=; b=IDmSmh2s9XBuPnNulA6ISti5BmxQdOv0iIdBxQW1nAYjJFMvROcTCc6k9fKRcn6lKC lkrwiecUizUC6pReWPmRkKlH+dytofzXJinK5c/gOC/6G/2/gSifHDHLoUtENk9BIIDu JEMNauiWez2vLZQlscnrjxHRin162bQPRT03Uin5DhRLjV8ry1LeSHakB+7JdBFr/QNL Fi2dp3NsbumNh64g2R7jRQK88q/njyDz0WQXR48UIntpGzIYRFKVBdwBx8rlhiR0u1AR +COmPVWcDP2PF62DPTEXhnXF7ytsOjddoWQG1HL8WcPcqV2+dGhMyU2iC3sg6hFj6unZ kZ3g== X-Gm-Message-State: ALoCoQlM4xoPJKKjPKUnB/40S7LLMaD7BxaVF/WNc3seW8awjZyoXFjgyYujJ255ptI3LkNUQUTO X-Received: by 10.194.238.202 with SMTP id vm10mr30603240wjc.96.1442246267790; Mon, 14 Sep 2015 08:57:47 -0700 (PDT) Received: from [192.168.1.12] (cpc79329-chap9-2-0-cust385.18-1.cable.virginm.net. [82.44.123.130]) by smtp.gmail.com with ESMTPSA id sd14sm16230737wjb.36.2015.09.14.08.57.46 (version=TLS1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Sep 2015 08:57:46 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <55F6B911.9080400@gmail.com> Date: Mon, 14 Sep 2015 16:57:45 +0100 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <96BE7F01-D04B-483B-B1A3-B45CED6DFCDC@craigfrancis.co.uk> References: <55DD4269.4090402@gmail.com> <6348DFA7-04BD-41BB-A500-17A8A531B56C@craigfrancis.co.uk> <55DDA4C9.9040603@gmail.com> <3C69BF4B-52E6-4D04-8601-8D23DFCC538E@craigfrancis.co.uk> <55DDD60F.5090509@gmail.com> <8C74463E-DBA2-4015-8159-0B44D973387F@craigfrancis.co.uk> <55DE0907.6040904@gmail.com> <1F615BCD-1B9B-4C51-A210-869F1AA1F6E3@craigfrancis.co.uk> <55E5EBBF.6020803@gmail.com> <0BA3A129-D356-4781-B6DE-E2B5A7924AE2@craigfrancis.co.uk> <55E6EC36.6090301@gmail.com> <9AF329EC-99A5-412D-A52B-432627A5520F@gmail.com> <6F4D91EE-B56E-4B83-B1AF-598C3F6897FC@craigfrancis.co.uk> <55F07BA4.2000204@gmail.com> <55F6B911.9080400@gmail.com> To: Rowan Collins X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: craig@craigfrancis.co.uk (Craig Francis) Hi Rowan, I think I've said everything I can from my point of view (and my = understanding of how other developers see and use the isset function). And that's not to say I disagree with what your saying Rowan, I'm just = voicing my view that I think a language with exists() would be nicer = than the slightly messy isset()... but each to their own. Maybe Scott (who proposed the idea) might follow up with more = information? Otherwise I'm off on holiday, see you in a few weeks :-) Craig On 14 Sep 2015, at 13:09, Rowan Collins wrote: > Craig Francis wrote on 14/09/2015 12:46: >> So yes, in the example above, an isset() would work, but I was trying = to show why I don't think it's odd to "suppress a warning for a plain = variable" when it does not exist. >=20 > Yes, and I agree that this example shows a reasonable use of isset(). = It works fine as it is, and doesn't need any functionality adding or = removing. >=20 >=20 >> Actually, I think they do use an array to store the values, then do = an extract() to make them local variables in the View (keeping the = variable names shorter and easier to read). >=20 > Incidentally, I've always wondered why extract() would ever be useful = in modern code, but I agree that if you don't want/need the overhead of = a separate template compiler, that approach actually works quite nicely. >=20 >=20 >> Yes, it is mis-used with arrays, but I would still argue that a = single exists() function would work better for all of these examples = when testing if they exist. >>=20 >> And I would hope that no-one was using an unset() as something = distinctly different from a NULL value. >=20 > If you don't need the ability to distinguish unset() from null, what = would any of these examples gain from using exists() over isset()? >=20 >=20 >> I agree that we should not have a function that distinguishes between = unset($foo) and $foo=3Dnull. >=20 > But if you take the "is null" check out of isset(), that's exactly = what you have; that's why the "is null" check is there in the first = place. >=20 > That's why I said I could agree with an exists() function (not under = that name) as a nicer syntax for array_key_exists(), but not as a = replacement for isset(). >=20 > You could have an exists() function which works like = array_key_exists() on an array, but identically to isset() on plain = variables, but I think that would just be confusing. Hence my suggestion = that any new function throw an error if given something other than an = array access. >=20 > Regards, > --=20 > Rowan Collins > [IMSoP]