On Fri, May 4, 2012 2:10 pm, Kris Craig wrote:
> On Fri, May 4, 2012 at 11:48 AM, Richard Lynch wrote:
>
>> On Wed, May 2, 2012 4:43 am, Pierre Joye wrote:
>> >>> empty() on the other hand, tests if something is empty, and only
>> if
>> >>> it
>> >>> is empty. The result of an expression can be e
>
>
> Hmm I'd never really thought about that before. But now that you mention
> it, that does sound like a problem. Honestly, I can see no value in
> maintaining a different "standard" for what constitutes a set or not-set
> variable depending on the function. While I understand Pierre's point
On Fri, May 4, 2012 at 1:27 PM, Ferenc Kovacs wrote:
>
>> I've been following the debate and I'm still a bit unclear as to what the
>> benefit would be to allowing non-variables in isset(). I mean, as was
>> stated earlier, expressions are neither "set" nor "unset". Furthermore,
>> if
>> you we
>
>
> I've been following the debate and I'm still a bit unclear as to what the
> benefit would be to allowing non-variables in isset(). I mean, as was
> stated earlier, expressions are neither "set" nor "unset". Furthermore, if
> you were to assign a variable to any valid expression (empty or ot
On Fri, May 4, 2012 at 11:48 AM, Richard Lynch wrote:
> On Wed, May 2, 2012 4:43 am, Pierre Joye wrote:
> >>> empty() on the other hand, tests if something is empty, and only if
> >>> it
> >>> is empty. The result of an expression can be empty.
> >>>
> >>
> >> an expression can also have a value
On Wed, May 2, 2012 4:43 am, Pierre Joye wrote:
>>> empty() on the other hand, tests if something is empty, and only if
>>> it
>>> is empty. The result of an expression can be empty.
>>>
>>
>> an expression can also have a value of null.
>
> And NULL is empty. No issue here.
Expressions can also r
Patrick ALLAERT wrote:
2012/5/3 Lester Caine:
Anthony Ferrara wrote:
I voted for the ability to use an expression for isset() as well,
since I agree with Ferenc, it's a matter of consistency. Sure, the
use-case for isset() is definitely weaker than for empty(), but at the
same token they are
>> I just can't help feeling that it is the wrong use of both. If the function
>> is returning a value, then it's returning a value that needs to be used
>> somewhere so the work flow handles that. If the function returns nothing
>> instead that just seems wrong and needs to be handled better. I'm
2012/5/3 Lester Caine :
> Anthony Ferrara wrote:
>>
>> I voted for the ability to use an expression for isset() as well,
>> since I agree with Ferenc, it's a matter of consistency. Sure, the
>> use-case for isset() is definitely weaker than for empty(), but at the
>> same token they are definitely
Anthony Ferrara wrote:
I voted for the ability to use an expression for isset() as well,
since I agree with Ferenc, it's a matter of consistency. Sure, the
use-case for isset() is definitely weaker than for empty(), but at the
same token they are definitely related...
I just can't help feeling
hi Anthony,
On Wed, May 2, 2012 at 1:37 PM, Anthony Ferrara wrote:
> I voted for the ability to use an expression for isset() as well,
> since I agree with Ferenc, it's a matter of consistency. Sure, the
> use-case for isset() is definitely weaker than for empty(),
No, it is not about consiste
On Wed, May 2, 2012 at 11:43 AM, Pierre Joye wrote:
> hi,
>
> On Wed, May 2, 2012 at 11:36 AM, Ferenc Kovacs wrote:
>
> > $foo=null;
> > var_dump(isset($foo)); //prints bool(false)
>
> No offset meant, but it is totally expected and well known, and as far
> as I remember documented too. Assignin
Pierre,
On Wed, May 2, 2012 at 5:43 AM, Pierre Joye wrote:
> hi,
>
> On Wed, May 2, 2012 at 11:36 AM, Ferenc Kovacs wrote:
>
>> $foo=null;
>> var_dump(isset($foo)); //prints bool(false)
>
> No offset meant, but it is totally expected and well known, and as far
> as I remember documented too. Ass
On Wed, May 2, 2012 at 11:43 AM, Pierre Joye wrote:
> hi,
>
> On Wed, May 2, 2012 at 11:36 AM, Ferenc Kovacs wrote:
>
>> $foo=null;
>> var_dump(isset($foo)); //prints bool(false)
>
> No offset meant,
lapsus :) s,offset,offense,
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.li
hi,
On Wed, May 2, 2012 at 11:36 AM, Ferenc Kovacs wrote:
> $foo=null;
> var_dump(isset($foo)); //prints bool(false)
No offset meant, but it is totally expected and well known, and as far
as I remember documented too. Assigning NULL to a variable unsets it
(so to say).
>> empty() on the other
On Wed, May 2, 2012 at 11:10 AM, Pierre Joye wrote:
> hi,
>
> On Wed, May 2, 2012 at 10:46 AM, Laruence wrote:
>
> >so I think if you want to change empty, you should also change isset.
>
> An expression is not set per se. isset goals, by design, from the very
> 1st day, is to test the exist
hi,
On Wed, May 2, 2012 at 10:46 AM, Laruence wrote:
> so I think if you want to change empty, you should also change isset.
An expression is not set per se. isset goals, by design, from the very
1st day, is to test the existence of a variable and a variable only.
empty() on the other hand,
On Mon, Apr 30, 2012 at 3:50 PM, Patrick ALLAERT wrote:
> Hi,
>
> 2012/4/12 Nikita Popov :
>> PS: I added isset() too, to address the consistency concerns mentioned on
>> IRC.
>
> I would have voted +1 if it didn't contain the isset() change. None of
> the examples used in the isset_with_expr.php
Sent from my iPhone
在 2012-5-2,3:52,Ferenc Kovacs 写道:
>>
>>
>> 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.
>>
>>
> yep,
>
>
> 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.
>
>
yep, and if we allow expressions then it is the expected behavior, but you
On Tue, May 1, 2012 at 7:24 PM, Patrick ALLAERT wrote:
> 2012/5/1 Ferenc Kovacs :
> > On Mon, Apr 30, 2012 at 2:39 PM, Nikita Popov >wrote:
> > - both isset and empty are language constructs, which many people use
> > almost interchangeability, changing one of them in a way that the same
> > expr
2012/5/1 Ferenc Kovacs :
> On Mon, Apr 30, 2012 at 2:39 PM, Nikita Popov
> 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 se
Hi,
On Tue, May 1, 2012 at 18:43, Ferenc Kovacs 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 interchang
On Mon, Apr 30, 2012 at 2:39 PM, Nikita Popov wrote:
> On Mon, Apr 30, 2012 at 9:50 AM, Patrick ALLAERT
> wrote:
> > Hi,
> >
> > 2012/4/12 Nikita Popov :
> >> PS: I added isset() too, to address the consistency concerns mentioned
> on IRC.
> >
> > I would have voted +1 if it didn't contain the is
hi,
On Mon, Apr 30, 2012 at 3:05 PM, Nikita Popov wrote:
> I changed the vote to have three options: "Both empty() and isset()",
> "Only empty()" or "None"
>
> https://wiki.php.net/rfc/empty_isset_exprs#vote
Please post a top thread to notice everyone about this new vote with a
short explanatio
On Mon, Apr 30, 2012 at 9:50 AM, Patrick ALLAERT wrote:
> Hi,
>
> 2012/4/12 Nikita Popov :
>> PS: I added isset() too, to address the consistency concerns mentioned on
>> IRC.
>
> I would have voted +1 if it didn't contain the isset() change. None of
> the examples used in the isset_with_expr.php
On Mon, Apr 30, 2012 at 9:50 AM, Patrick ALLAERT wrote:
> Hi,
>
> 2012/4/12 Nikita Popov :
>> PS: I added isset() too, to address the consistency concerns mentioned on
>> IRC.
>
> I would have voted +1 if it didn't contain the isset() change. None of
> the examples used in the isset_with_expr.php
Hi,
2012/4/12 Nikita Popov :
> PS: I added isset() too, to address the consistency concerns mentioned on IRC.
I would have voted +1 if it didn't contain the isset() change. None of
the examples used in the isset_with_expr.phpt test seems logic to me.
Care to explain the consistency concerns here
On Fri, Apr 13, 2012 at 12:42 AM, Galen Wright-Watson
wrote:
> Just to be clear, under the new behavior, calling "empty" or "isset" on
> undefined variables and undefined array indices shouldn't produce a notice
> when E_NOTICE is set, correct? Basically, the change isn't regressive.
Yup, that's r
On Thu, Apr 12, 2012 at 2:42 PM, Nikita Popov wrote:
>
> As per the comments I created an RFC, proposing to allow arbitrary
> expressions to be passed to empty() and isset():
>
> https://wiki.php.net/rfc/empty_isset_exprs
>
> The patch is available as a PR:
>
> https://github.com/php/php-src/pull/
Hi internals!
As per the comments I created an RFC, proposing to allow arbitrary
expressions to be passed to empty() and isset():
https://wiki.php.net/rfc/empty_isset_exprs
The patch is available as a PR:
https://github.com/php/php-src/pull/54
Nikita
PS: I added isset() too, to address the co
31 matches
Mail list logo