Re: [RFC] Allow non-variable arguments to empty() and isset()

From: Date: Tue, 01 May 2012 16:52:09 +0000
Subject: Re: [RFC] Allow non-variable arguments to empty() and isset()
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-60399@lists.php.net to get a copy of this message
Hi, On Tue, May 1, 2012 at 18:43, Ferenc Kovacs <tyra3l@gmail.com> wrote: > > albeit I'm not laruence, but I also supported the idea to keep consistency > across the allowed params of empty and isset. > here is my reasoning: > - both isset and empty are language constructs, which many people use > almost interchangeability, changing one of them in a way that the same > expression works with one of them, but blows up with a parse error seems > wrong to me. > - maybe you think that isset doesn't really make sense with expressions, > but don't forget that this patch would also allow constants to be used with > empty/isset, and imo isset(some_constant); would be useful and maybe more > straightforward for the people new to the language. So isset(UNDEFINEDCONSTANT) will be isset("UNDEFINEDCONSTANT") which will/should 1) yield a notice, which is unnexpected for isset 2) return true, which is also unexpected. I don't see much point in that. Best regards, -- Etienne Kneuss http://www.colder.ch

« previous php.internals (#60399) next »