Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88283 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27976 invoked from network); 17 Sep 2015 13:10:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2015 13:10:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=terry@terah.com.au; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=terry@terah.com.au; sender-id=pass Received-SPF: pass (pb1.pair.com: domain terah.com.au designates 209.85.160.180 as permitted sender) X-PHP-List-Original-Sender: terry@terah.com.au X-Host-Fingerprint: 209.85.160.180 mail-yk0-f180.google.com Received: from [209.85.160.180] ([209.85.160.180:34561] helo=mail-yk0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/14-33947-3BBBAF55 for ; Thu, 17 Sep 2015 09:10:12 -0400 Received: by ykdg206 with SMTP id g206so15940718ykd.1 for ; Thu, 17 Sep 2015 06:10:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=rsOnSeMP+D+Kf0eXL1K1GaseoN+++SgpjHNBe3WA6f8=; b=YXgqSN0PnYtSkh8qF4sMyATEuFGwp88Rw3LmHOB88WsU7bsaXGHPKN68NbbvEAKyWn jLvomjduowU/Z+HoKZ7lsDHg1YGLoD3XtXso5uqhA/6gqlMt/kqzJjA00Iiw/2W3IZCI +dWNDTcBHF6MTZt8jaUJcYfgb1MYaJYmyIwnZEGwNH5jWfwHU/Y0iuFc7sAhoPk6+0Xv kQauQwPmxLymLGhKy47BoXdyBKITKrKTGJ2EeWrrEijfZCkbWGqJlprOMhl+pxa7lf0Q oKBVYdQGWeGVqRBsjVGxAMpm2KOEr/znfkEzPnfVuskM5cCRkGEUzGUq1mk3mjfrnrGM tSKQ== X-Gm-Message-State: ALoCoQmGlHhq3znP2D7zZfHf45ZSwgtysd4stU/5Gt81IXzfIAXw+g0J+m9HwiS15FJzUA9b50DQ X-Received: by 10.170.147.2 with SMTP id o2mr34435475ykc.2.1442495408504; Thu, 17 Sep 2015 06:10:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.215.197 with HTTP; Thu, 17 Sep 2015 06:09:38 -0700 (PDT) X-Originating-IP: [101.165.94.3] In-Reply-To: <55FAB790.9020905@gmail.com> References: <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> <96BE7F01-D04B-483B-B1A3-B45CED6DFCDC@craigfrancis.co.uk> <55F6F08C.1020506@gmail.com> <0BEF6D82-CB5F-49F6-A3A4-3267924A0CDA@thesba.com> <55F72CA9.2060301@gmail.com> <09369945-76FE-4E08-9C2C-15FB0577AD27@thesba.com> <55F752E7.9070801@gmail.com> <55F9B4C7.3050700@gmail.com> <440C64A2-4B4F-4AEF-ACE3-F3A6637EBAB6@thesba.com> <55F9E5E7.3030408@gmail.com> <711C7F58-6187-4ED2-8314-EB217DF0EC2B@thesba.com> <55FAB790.9020905@gmail.com> Date: Thu, 17 Sep 2015 23:09:38 +1000 Message-ID: To: Rowan Collins Cc: internals Content-Type: multipart/alternative; boundary=001a11391e5a6a51bd051ff122df Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: terry@terah.com.au (Terry Cullen) --001a11391e5a6a51bd051ff122df Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E2=80=8BHi Rowan,=E2=80=8B On 17 September 2015 at 22:52, Rowan Collins wrote: > Terry Cullen wrote on 17/09/2015 13:41: > >> Here is an example where exists would be useful; >> > > You answered your own request: > > // I should have used property_exists() instead of isset().. wasn't >> expecting a null.. >> > > We already have that function, so that's alright then! :) > > As I've said several times, we need to improve documentation around this, > but "I didn't find the existing function, so I need a new function which > will be no easier to find and won't work in most people's environments" i= s > a pretty weak argument in favour of a language change. > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > =E2=80=8BI agree that there is already ways around this issue, but I agree = with Bob that there is a hole that exists() would fill. I my world where PHP is the glue between JSON requests and database queries, =E2=80=8Bexists() would be= a function I'd use way more the array_key_exists(), property_exists(), isset() and empty(). Further, in some scenarios exists($foo->bar) would replace isset($foo) && is_object($foo) && property_exists($foo, 'bar'). --001a11391e5a6a51bd051ff122df--