Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87932 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77543 invoked from network); 26 Aug 2015 13:54:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Aug 2015 13:54:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=craig@craigfrancis.co.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=craig@craigfrancis.co.uk; sender-id=pass Received-SPF: pass (pb1.pair.com: domain craigfrancis.co.uk designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: craig@craigfrancis.co.uk X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:37640] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/53-17883-4F4CDD55 for ; Wed, 26 Aug 2015 09:53:57 -0400 Received: by widdq5 with SMTP id dq5so16173066wid.0 for ; Wed, 26 Aug 2015 06:53:54 -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=LIrBiMIpZIQ4O9e4enqQFOKPf57VKNFnGqkpB7uNj6Y=; b=EuL8LuRddRX04NUSY1yMRd0oT1WQ84O3nry03Fn37biGRiWOaFNznuPY2PFTzTjV4N FIW31hgSfyOcfYMvawAnW5w5JO4JjnsnAnPqQhwX5tuY9Sf5Zllgj8elqE486l8vwTJw a7pZTd+chOG8FEYj/V4U8L1uoVd6WMhKFA9RY= 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=LIrBiMIpZIQ4O9e4enqQFOKPf57VKNFnGqkpB7uNj6Y=; b=Op8+rq4QRo4EPxGA+W113ITaVjokyHMiy3ogATeMWAS8f7VEVbB9LiTY51Ht/Xztg4 2JeVmipTXwI+4/3TTkp/uDvvN1BaTW5YY00DyJfAa5l/90GK9DJTuRx/vb5Rl+1QHguw sVsf+4OZQzRB0sj/F00TwpMUBa7gAAJ4QDmdlBTdrdCplRRGnNj5TtXDpH1khXocamhZ hH2cczR5JazkgYJMt89DaHVro+a5K6EX0ElmDEc9Nnog9ueeBiVAexFv37N1yCZ6gxYG 09kdOfO6TyULupKpeBL+3MWMdMZYSUQ5fAvJdspzhRrylFpfNmXDphXwtCbr1ehyWTI9 M7rw== X-Gm-Message-State: ALoCoQmyHHP9oOa0EMyRjBtIAiuubuXmm0RK6fAcUlssU6hb5puf7D8Z7Anb/QuMU103sYaPsrTd X-Received: by 10.194.178.1 with SMTP id cu1mr58968782wjc.59.1440597234059; Wed, 26 Aug 2015 06:53:54 -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 ej5sm3996050wjd.22.2015.08.26.06.53.53 (version=TLS1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Aug 2015 06:53:53 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <55DDA4C9.9040603@gmail.com> Date: Wed, 26 Aug 2015 14:53:51 +0100 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <3C69BF4B-52E6-4D04-8601-8D23DFCC538E@craigfrancis.co.uk> References: <55DD4269.4090402@gmail.com> <6348DFA7-04BD-41BB-A500-17A8A531B56C@craigfrancis.co.uk> <55DDA4C9.9040603@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) On 26 Aug 2015, at 12:36, Rowan Collins wrote: > Fortunately, the function you are looking for already exists: = http://php.net/array_key_exists It does, although I seem to have edited that out of my reply... was = trying to keep it short ;-) At the moment I'm out of examples (bit busy at the moment), but I do = know that when I'm doing an isset() check, I'm really wanting to know if = the variable (or key) exists, where NULL may be a perfectly valid value. So there is a slight annoyance (and typically a quick fix) to identify = if the variable has just been set to NULL. On 26 Aug 2015, at 12:36, Rowan Collins wrote: > Craig Francis wrote on 26/08/2015 12:23: >>=20 >> If you want some example of where I got this wrong... >>=20 >> I have a config array [...] >>=20 >> When creating a URL builder that allowed the query string to be = passed in as an array [...] >>=20 >> Neither were major problems, just a slight annoyance (i.e. identified = and fixed before I committed the code). But I'm normally using an = isset() as the proposed exists() function would work. >=20 > Both of these example involve not an undefined variable, but an = undefined array key, which is a much less controversial scenario. >=20 > Fortunately, the function you are looking for already exists: = http://php.net/array_key_exists >=20 > Regards, > --=20 > Rowan Collins > [IMSoP] >=20 >=20 >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20