Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75246 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20240 invoked from network); 4 Jul 2014 08:01:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2014 08:01:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=petercowburn@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=petercowburn@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.49 as permitted sender) X-PHP-List-Original-Sender: petercowburn@gmail.com X-Host-Fingerprint: 209.85.216.49 mail-qa0-f49.google.com Received: from [209.85.216.49] ([209.85.216.49:65429] helo=mail-qa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/C1-06026-94F56B35 for ; Fri, 04 Jul 2014 04:01:14 -0400 Received: by mail-qa0-f49.google.com with SMTP id w8so1062283qac.22 for ; Fri, 04 Jul 2014 01:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=WtYFYIkGVJMu/FNgAg/1qxWsHubh8tHdXywVeA954JM=; b=A+kEo/dOeyJSSLcSio8IEKbcO4nsSy52bNckPBOC+AwwZzhLSovGQZfvvavvFR4/fb Z8y01hb2V7Rp2wYar8s2/4QJ0B7G5/ISu3KTFOer8VXV8cRxN7SPkUIwtuU15JSComNp ak3A0LmQk/RDPxb0avLJqaNMNejMXiaC5+2Udo3NhTKOby6g7Guis4TxF100vEzEY8MX gDJUKunT4Q6w7fw0/CvvJ0A4hkOjD/3CHW7781Y7NEA1j7VjXDZrmUjdfYL7G4vMxQsO Lsn2qYD9ZYWJhIlzuxfz9pdk4T0yj7dZaL4XKNbb1kLfyuhW3EfaCRbAeZDD/D5Juiur /8EQ== X-Received: by 10.224.61.1 with SMTP id r1mr14812618qah.95.1404460871621; Fri, 04 Jul 2014 01:01:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.173.99 with HTTP; Fri, 4 Jul 2014 01:00:31 -0700 (PDT) In-Reply-To: References: <53B65712.2070207@sugarcrm.com> Date: Fri, 4 Jul 2014 09:00:31 +0100 Message-ID: To: Kris Craig Cc: Stas Malyshev , Andrey Andreev , PHP internals Content-Type: multipart/alternative; boundary=001a11c3f4d45aa25804fd5987c0 Subject: Re: [PHP-DEV] not_null function From: petercowburn@gmail.com (Peter Cowburn) --001a11c3f4d45aa25804fd5987c0 Content-Type: text/plain; charset=UTF-8 On 4 July 2014 08:43, Kris Craig wrote: > On Fri, Jul 4, 2014 at 12:26 AM, Stas Malyshev > wrote: > > > Hi! > > > > > Not any that I'm aware of, and I personally have never used is_null(). > > > I share your opinion that we don't really need is_null(), but with BC > > > in mind, I don't think it would get removed. > > > > There's nothing to remove. Every type has is_* function, including null > > type. If is_null() is offensive to somebody for some reason, that person > > is free to not use it. > > > > I'm not offended by it and I get that it was initially created for the sake > of having an is_* function for each type. I'm just trying to understand > why it's *still* there and why it's not a language construct. It serves no > unique purpose and has a negative performance impact. > > What would be wrong with changing it from a function to a language > construct like isset() and empty()? If is_null() were the equivalent of > !isset( $var ) || $var === NULL, it would make a hell of a lot more sense > than what's there now. > I don't use it often, and there are certainly other ways to achieve the same result, but I have been known to employ the function as a callback (e.g. to array_filter()) on occasion. I'm not saying there's solid reason to keep it around, just giving one example of a) where I've made use of it before, and b) where changing it to a language construct would be counter-productive. Can we move on to frying bigger fish?! > --Kris > --001a11c3f4d45aa25804fd5987c0--