On Thu, Oct 24, 2019 at 4:55 PM Ken Stanley <doh...@gmail.com> wrote:

> > isset($_SERVER['fname']) && $user->setName($_SERVER['fname']);
> >
> > Will return boolean.
> >
>
> Just testing the waters: Is there any appetite to have AND and OR behave
more like Pythons operator?
Instead of now:
(a or b) => bool(true) if either of a or b are true
(a and b) =>  bool(true) is either of a or b are true

Behave as:
(a or b) => Value of a if true, b if a is not true but b is, bool(false)
otherwise.
(a and b) => Value of b if both are true, bool(false) otherwise.

Coincidentally, this change to T_LOGICAL_AND would server OP's purpose.

I'll tell ya, I'm leaning "No" because BC, but at the same time, AND/OR
seem to be underutilized constructs and I *suspect* (having done zero
research), that most existing uses would yield the same result as they do
now.

-Sara

Reply via email to