Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88331 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65794 invoked from network); 18 Sep 2015 15:17:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Sep 2015 15:17:49 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:39084] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/E0-60254-B1B2CF55 for ; Fri, 18 Sep 2015 11:17:48 -0400 Received: (qmail 8386 invoked by uid 89); 18 Sep 2015 15:17:44 -0000 Received: by simscan 1.3.1 ppid: 8378, pid: 8383, t: 0.1503s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@86.160.91.166) by mail4.serversure.net with ESMTPA; 18 Sep 2015 15:17:44 -0000 To: internals@lists.php.net References: <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> <55F9D704.5050002@lsces.co.uk> <55F9EFA2.9020908@lsces.co.uk> <0022A1D9-DC37-4F49-B58E-FBED5AF872BA@gmail.com> <55F9FAB3.2050100@lsces.co.uk> <55FB19CB.7080707@gmail.com> <55FB3117.5040204@lsces.co.uk> <55FB3A60.1040601@gmail.com> <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> Message-ID: <55FC2B17.3070909@lsces.co.uk> Date: Fri, 18 Sep 2015 16:17:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55FC2588.6030809@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: lester@lsces.co.uk (Lester Caine) On 18/09/15 15:54, Rowan Collins wrote: >> On 18/09/15 15:06, Rowan Collins wrote: >>> A PHP variable can have all sorts of states, because you can take >>> advantage of loose typing: >>> >>> $date = new DateTime(); >>> $date = null; >>> $date = 'TODAY'; >>> $date = -1; >>> $date = M_PI; >> And isset() returns true for every one but 'null' so how do I identify a >> variable that isset=null? > > Why do you need to, when you've got all these values to choose from? Why > concentrate on the thing you can't do, when you could look at the huge > array of things you can do? > > Yes, if exists() existed, you could use it as an extra state, but it > doesn't, so you can't. You don't do much real database coding do you ... NULL is returned for fields that have no entry on a secondary table, so the result set NATURALLY returns NULL. We have been living with the fact that PHP barf's when trying to check for NULL for a long time. There are a number of ways those variables can be generated and switching off the notices is currently the only way. exists() has a place in SOME coding styles which does not require to find the 'NULL' some other way to avoid the potential notice! Converting it to something else at the database end is just another hack? Yes I do things differently, but certainly in Smarty this one has come up more than once, and the general statement to 'switch of notices' in production is another questionable restriction. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk