Re: not_null function

From: Date: Fri, 04 Jul 2014 07:43:25 +0000
Subject: Re: not_null function
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-75244@lists.php.net to get a copy of this message
On Fri, Jul 4, 2014 at 12:26 AM, Stas Malyshev <smalyshev@sugarcrm.com> 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. --Kris

« previous php.internals (#75244) next »