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

From: Date: Tue, 01 May 2012 17:24:05 +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-60400@lists.php.net to get a copy of this message
2012/5/1 Ferenc Kovacs <tyra3l@gmail.com>: > On Mon, Apr 30, 2012 at 2:39 PM, Nikita Popov <nikita.ppv@googlemail.com>wrote: > - 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. I wish that more wrong usages could blow up with parse errors way before waiting for the incorrect line to be run. While there is some valid use cases for empty() I see none for isset(), it must remain a targeted and specific construct IMHO. > - maybe you think that isset doesn't really make sense with expressions, exact :) > but don't forget that this patch would also allow constants to be used with > empty/isset. That is not a very good think IMO. For the same reason: this patch would also allow writing: empty( false ) or empty( null ) which are both clueless. The fact that this patch would now allow syntactically doubtful things doesn't mean they should be encouraged nor propagated to isset(). Cheers, Patrick

« previous php.internals (#60400) next »