Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75245 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18704 invoked from network); 4 Jul 2014 07:57:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jul 2014 07:57:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=mats.lindh@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mats.lindh@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.46 as permitted sender) X-PHP-List-Original-Sender: mats.lindh@gmail.com X-Host-Fingerprint: 209.85.216.46 mail-qa0-f46.google.com Received: from [209.85.216.46] ([209.85.216.46:32972] helo=mail-qa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/71-06026-57E56B35 for ; Fri, 04 Jul 2014 03:57:41 -0400 Received: by mail-qa0-f46.google.com with SMTP id i13so1070513qae.33 for ; Fri, 04 Jul 2014 00:57:38 -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=YwRstQSGL3X3im3ctFCmnWP+Tgoe44tUbPq1nNcP5fw=; b=DJWt+507BStM/m/eBobusy0CZp3ESBR/9lNRZaU32BE8fq0kp+tgtt8I/skfR6z1Os b0d/SuFX4IV44So4oXmtoJT6SQQN18gnt/7GZl6YgtTym8rO3GAChYif4grjnpgP87o8 1x8RtdCgrlwpTK4glVbiKRUXCPUskF2ORBnyrsq0pGEx73Vqf2fs+LirMpJBdjOMkF8B p9rEK4GzQckFlEbGJQI39TvY5vNQ55uALrLVUbRWqaBPnt1h1o0uVZE3hmx9BGQ6sei0 xM2XxaQJK4MRDwGj4b8r49f48e8qwAF77n063bAu/yhn9FZXULdp+IthnZzRlWFrf7cI d8Qg== MIME-Version: 1.0 X-Received: by 10.229.204.200 with SMTP id fn8mr15667251qcb.14.1404460658278; Fri, 04 Jul 2014 00:57:38 -0700 (PDT) Received: by 10.140.95.4 with HTTP; Fri, 4 Jul 2014 00:57:38 -0700 (PDT) In-Reply-To: References: <53B65712.2070207@sugarcrm.com> Date: Fri, 4 Jul 2014 09:57:38 +0200 Message-ID: To: Kris Craig Cc: PHP internals Content-Type: multipart/alternative; boundary=001a1132eccaa348e004fd597ac2 Subject: Re: [PHP-DEV] not_null function From: mats.lindh@gmail.com (Mats Lindh) --001a1132eccaa348e004fd597ac2 Content-Type: text/plain; charset=UTF-8 On Fri, Jul 4, 2014 at 9:43 AM, Kris Craig wrote: > 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. > So your suggestion is to make it _exactly_ like isset? Remember that language constructs are, in general, a cludge. They appear to be functions, but you can't use them in places where you'd use a function, such as validation callbacks. If you make is_null a language construct, validate($foo, 'is_null') would not work as people assume. There is no utility gained from removing or changing is_null. It complements the other is_* functions that check for a specific type, and having more than one way to achieve something is not always a bad idea. Let this one rest. --mats --001a1132eccaa348e004fd597ac2--