RE: [PHP-DEV] not_null function

2014-07-06 Thread Robert Stoll
> -Original Message- > From: Kris Craig [mailto:kris.cr...@gmail.com] > Sent: Saturday, July 05, 2014 3:22 AM > To: Xen > Cc: Levi Morrison; internals > Subject: Re: [PHP-DEV] not_null function > > On Fri, Jul 4, 2014 at 2:38 PM, Xen wrote: > > >

RE: [PHP-DEV] not_null function

2014-07-06 Thread Robert Stoll
> -Original Message- > From: Pierre Joye [mailto:pierre@gmail.com] > Sent: Saturday, July 05, 2014 10:06 AM > To: Tjerk Meesters; PHP internals > Subject: Re: [PHP-DEV] not_null function > > On Jul 5, 2014 9:43 AM, "Tjerk Meesters" > wrote: > >

Re: [PHP-DEV] not_null function

2014-07-05 Thread Andrea Faulds
> On July 5, 2014 at 9:05 AM Pierre Joye wrote: > > > On Jul 5, 2014 9:43 AM, "Tjerk Meesters" > wrote: > > > > > Obviously spoke to soon ... what I've written there is basically an ugly > > `!isset($var)`. > > > > Totally fail to see what is ugly with is set or the difference with > exists

Re: [PHP-DEV] not_null function

2014-07-05 Thread Pierre Joye
On Jul 5, 2014 9:43 AM, "Tjerk Meesters" wrote: > > Obviously spoke to soon ... what I've written there is basically an ugly > `!isset($var)`. > Totally fail to see what is ugly with is set or the difference with exists(). The latter, in the context of php (even more with phpng) makes little sen

Re: [PHP-DEV] not_null function

2014-07-05 Thread Tjerk Meesters
On Sat, Jul 5, 2014 at 3:39 PM, Tjerk Meesters wrote: > > > > On Sat, Jul 5, 2014 at 9:22 AM, Kris Craig wrote: > >> On Fri, Jul 4, 2014 at 2:38 PM, Xen wrote: >> >> > On Fri, 4 Jul 2014, Levi Morrison wrote: >> > >> > For completeness, it is available in Perl and I believe Perl had it >> >> f

Re: [PHP-DEV] not_null function

2014-07-05 Thread Kris Craig
> > >> Currently, this is what's available for checking a variable's status >> without throwing any errors: >> >> Variable exists and !== NULL: isset( $var ) >> Variable === NULL or doesn't exist: !isset( $var ) >> Variable == NULL or doesn't exist: empty( $var ) >> Variable exists and != NULL:

Re: [PHP-DEV] not_null function

2014-07-05 Thread Tjerk Meesters
On Sat, Jul 5, 2014 at 9:22 AM, Kris Craig wrote: > On Fri, Jul 4, 2014 at 2:38 PM, Xen wrote: > > > On Fri, 4 Jul 2014, Levi Morrison wrote: > > > > For completeness, it is available in Perl and I believe Perl had it > >> first; not completely sure though. > >> > > > > Okay, I never used Perl.

Re: [PHP-DEV] not_null function

2014-07-04 Thread Kris Craig
On Fri, Jul 4, 2014 at 2:38 PM, Xen wrote: > On Fri, 4 Jul 2014, Levi Morrison wrote: > > For completeness, it is available in Perl and I believe Perl had it >> first; not completely sure though. >> > > Okay, I never used Perl. > > > I don't think changing isset would be beneficial, sadly. I wi

Re: [PHP-DEV] not_null function

2014-07-04 Thread Xen
On Fri, 4 Jul 2014, Levi Morrison wrote: For completeness, it is available in Perl and I believe Perl had it first; not completely sure though. Okay, I never used Perl. I don't think changing isset would be beneficial, sadly. I wish it only checked that a variable exists and didn't do the no

Re: [PHP-DEV] not_null function

2014-07-04 Thread Levi Morrison
On Fri, Jul 4, 2014 at 2:27 PM, Xen wrote: > Op Fri, 04 Jul 2014 14:34:17 +0200 schreef Robert Stoll : > > >> [Robert Stoll] >> >> I really like how ruby tackles this problem with the syntactic sugar >> "unless" which basically is a substitute for "if( !() )". >> Maybe we could consider to introdu

Re: [PHP-DEV] not_null function

2014-07-04 Thread Xen
Op Fri, 04 Jul 2014 14:34:17 +0200 schreef Robert Stoll : [Robert Stoll] I really like how ruby tackles this problem with the syntactic sugar "unless" which basically is a substitute for "if( !() )". Maybe we could consider to introduce it in PHP next? It is very natural to read "unless(is_

RE: [PHP-DEV] not_null function

2014-07-04 Thread Robert Stoll
Hey, > -Original Message- > From: Xen [mailto:x...@dds.nl] > Sent: Thursday, July 03, 2014 11:40 AM > To: internals@lists.php.net > Subject: [PHP-DEV] not_null function > > Heya, > > I was just wondering about something. > > It seems way more natu

Re: [PHP-DEV] not_null function

2014-07-04 Thread Kris Craig
On Fri, Jul 4, 2014 at 12:57 AM, Mats Lindh wrote: > 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

Re: [PHP-DEV] not_null function

2014-07-04 Thread Peter Cowburn
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

Re: [PHP-DEV] not_null function

2014-07-04 Thread Mats Lindh
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. >

Re: [PHP-DEV] not_null function

2014-07-04 Thread Kris Craig
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

Re: [PHP-DEV] not_null function

2014-07-04 Thread Stas Malyshev
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 offensi

Re: [PHP-DEV] not_null function

2014-07-04 Thread Andrey Andreev
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. Cheers, Andrey. On Fri, Jul 4, 2014 at 1:47 AM, Kris Craig wrote: >> $var !== null >> ! is_null($