Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88383 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19297 invoked from network); 20 Sep 2015 00:43:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Sep 2015 00:43:11 -0000 Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.195 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.212.195 mail-wi0-f195.google.com Received: from [209.85.212.195] ([209.85.212.195:35275] helo=mail-wi0-f195.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/38-43089-D110EF55 for ; Sat, 19 Sep 2015 20:43:10 -0400 Received: by wicxq10 with SMTP id xq10so14176798wic.2 for ; Sat, 19 Sep 2015 17:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UCelbLEMvfGE69zE8cXvo2TVihlOpTVozHVELCx+O/Y=; b=mi7rdfBxhDvALkbYyU+fRgNPyqLDhGQiotfroM3n2Fv0F3xnO1dioJPzHRoez0Yyyt moh0cQ/YVltRrAgTOUZo5C085kDjpgKxNq6dytqL4XOE0CJKR7PbB6AIoOWI6mvtJwyD hzGgryIEtyRSxg47t/bOLBFUt5Tq1oO94fgmMLCkhWyUGyJRqtVho5LVo9Oes+ieAXzo 0f94XnuiOH2tDlCq9UYquGR7Y3BEeU7f2kacHwFKR72+EkX5DMorhbi48BI9kG+gUOGE rPnhW/6rwpIRUkjKzhv4GAcIjgjshTX9CvoWZRLY2eBPvn6PG2XrMECn2poPYZa/IqT4 AdCA== MIME-Version: 1.0 X-Received: by 10.180.106.99 with SMTP id gt3mr5245108wib.51.1442709786633; Sat, 19 Sep 2015 17:43:06 -0700 (PDT) Received: by 10.28.183.130 with HTTP; Sat, 19 Sep 2015 17:43:06 -0700 (PDT) In-Reply-To: <55FDEFEC.80101@lsces.co.uk> References: <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> <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> <55FDD71F.6070101@lsces.co.uk> <55FDDA0E.3050003@gmail.com> <55FDEFEC.80101@lsces.co.uk> Date: Sat, 19 Sep 2015 18:43:06 -0600 Message-ID: To: Lester Caine Cc: Rowan Collins , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d04428e5658a9770520230c1d Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: derokorian@gmail.com (Ryan Pallas) --f46d04428e5658a9770520230c1d Content-Type: text/plain; charset=UTF-8 On Sat, Sep 19, 2015 at 5:29 PM, Lester Caine wrote: > On 19/09/15 22:56, Rowan Collins wrote: > >>> If what you want to do is avoid the notice, then you don't need to > >>> "find out before calling is_null", you need to call isset *instead > >>> of* is_null. Again, ignore the name, and concentrate on what it > >>> actually does. > >> BUT ISSET RETURNS FALSE FOR A VARIABLE THAT IS SET BUT NULL ... END OF > >> STORY ... > > > > AND SO DOES IS_NULL > > > > The notices emitted by is_null are COMPLETELY IRRELEVANT. > > ? is_null returns true if the variable exists and is NULL and throws a > notice if the variable is not set WHY is that fact COMPLETELY > IRRELEVANT? Just because you don't think people should be coding in the > way that it causes problems with existing code does not make it > irrelevant we have to put up with the notices because there is no CLEAN > way to establish that a variable exists only that it is set. > I would also point out that is_null returns true (after the engine produces a notice) for undefined variables: $ php -r "var_dump(is_null($a));" Notice: Undefined variable: a in Command line code on line 1 Call Stack: 0.0001 118888 1. {main{() Command line code:0 *bool(true)* So is_null does not help to determine if a plain variable is in fact null. --f46d04428e5658a9770520230c1d--