Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88436 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62323 invoked from network); 23 Sep 2015 10:41:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2015 10:41:26 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:36537] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 62/D5-10948-5D182065 for ; Wed, 23 Sep 2015 06:41:26 -0400 Received: by wicgb1 with SMTP id gb1so199291098wic.1 for ; Wed, 23 Sep 2015 03:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=0sDGJOkvFHNymCvXMz/BQVlFoFHkiPaDVlq9fHXDm9M=; b=nkCFP7YIw4XGP8OWm5CC7jrGdNMIhmQxYNtvFoXnhR0yC3CJFDe3OoQ51kjYSTazWH mgEiQxsC12Da5EnpZjlX29OcSZC5WKyz8I61ZjLFXTUUqwn6rRcDZyDeikk40iIHyXrq 408xxaY6SZ311PT2iPyWp2xE6B58Apdc5xtL1bIxt2msrscHlf6CB0UTD0Nt1aVbie4/ +WUd9R8epiSp8WbJq251F0OYdcvS3RVD7O7oI21WCjqUdWr3c/fNHxfkg7otEzTCvBzO r0OMIY6Kvb1eaWYCzYGYkm4H0dWTWW9ohLlh1hv2Y5BLOGZ6eSxIBFdDhnzLBux67ppF 12lw== X-Received: by 10.194.121.66 with SMTP id li2mr15799411wjb.31.1443004881522; Wed, 23 Sep 2015 03:41:21 -0700 (PDT) Received: from [192.168.0.119] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id uc12sm7886027wib.13.2015.09.23.03.41.20 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Sep 2015 03:41:20 -0700 (PDT) To: internals@lists.php.net References: <55FB4270.7000204@lsces.co.uk> <55FB4969.7080600@gmail.com> <55FB5BA6.6050606@lsces.co.uk> <55FBF265.5000502@gmail.com> <55FBF7B7.4050603@lsces.co.uk> <55FC1A77.7090406@gmail.com> <55FC221A.7020108@lsces.co.uk> <55FC2588.6030809@gmail.com> <55FC2B17.3070909@lsces.co.uk> <55FC2F2F.9060403@gmail.com> <55FC33F1.3090903@lsces.co.uk> <55FC354B.5070209@gmail.com> <55FC39B2.5070005@lsces.co.uk> <55FC45C7.9010202@gmail.com> <55FC4991.1050903@lsces.co.uk> <7872E9F4-AE19-4681-B2EF-215751AE4CBE@thesba.com> <55FC5A14.8020301@gmail.com> <55FC8D53.3080904@lsces.co.uk> <93020C79-3920-4FC8-8B6B-F1D16C6C709C@gmail.com> <55FD7613.1080403@lsces.co.uk> <9B86E351-089D-4356-BC8A-F683BA31D1A8@gmail.com> <5602778C.2070205@gmail.com> <56027EC6.1020206@lsces.co.uk> Message-ID: <560281B9.5050808@gmail.com> Date: Wed, 23 Sep 2015 11:40:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <56027EC6.1020206@lsces.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: rowan.collins@gmail.com (Rowan Collins) Lester Caine wrote on 23/09/2015 11:28: > Yes from one point of view the > problem is not with is_null() and I can agree with that. The problem is > that one can't establish that a call to is_null() is going to access a > valid variable while only working in the simple procedural layer. You can't establish that a call to any function is going to access a valid variable (other than the way Michael mentioned). It really has nothing to do with is_null(), and therefore with the notices that is_null() emits. > exists() -> empty() or is_null() answers all cases and isset() is > redundant but for BC reasons can't be removed. Lots of functions are redundant in that they can be built using other functions. I don't see "if ( exists($foo) && ! is_null($foo) )" as an improvement over "if ( isset($foo) )" for the extremely common case where you don't want or need any distinction between the two states, though. > Using isset() in place of exists() is NOT a valid substitution since one > can't then call is_null() KNOWING that the variable does exist. I think you're flogging a dead horse here. We all agree that isset() does not check for variable existence. Also, calling both isset() and is_null() on the same variable is entirely pointless, because they both make exactly the same check. "if ( isset($foo) && is_null($foo) )" can be simplified to "if ( false )". > we have hopefully established that the null state is a natural > result of interaction with a database Indeed, I have never disputed that. A non-existent variable, however, is not something I've ever come across in a database context - it would seem to require a result set having rows with different numbers of columns. Regards, -- Rowan Collins [IMSoP]