Re: Bug #18214 Updated: Request: Warning on assignment in IF expression.
| From: | Derick Rethans | Date: | Tue, 09 Jul 2002 06:20:24 +0000 |
| Subject: | Re: Bug #18214 Updated: Request: Warning on assignment in IF expression. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-85849@lists.php.net to get a copy of this message | ||
Philip,
On 9 Jul 2002 philip@php.net wrote:
> What are some other potential "strict" mode watches? Some people ask
> for an optional "strict" mode with various options, this could be a
> good start? Imagine a strict mode directive where when on, various
> options could be set at runtime, like assignment_inside_expression =
> true :)
You can better do this discussion on php-dev, as not a lot people read
the bug list.
Derick
>
>
> Previous Comments:
> ------------------------------------------------------------------------
>
> [2002-07-08 10:19:16] m.ford@lmu.ac.uk
>
> Rare??? What do you mean, rare???
>
> Nearly every script I write uses this construct multiple times.
> Sometimes, it occurs more often than equality comparisons. Changing
> this would make my life hell!!
>
> Cheers!
>
> Mike
>
> ------------------------------------------------------------------------
>
> [2002-07-07 18:18:31] jan@php.net
>
> on a side note, it is a good practice to swap the 'assignment
> arguments':
> if ('foo' == $bar), since 'foo' = $bar does produce a warning.
>
>
>
> ------------------------------------------------------------------------
>
> [2002-07-07 17:55:54] djanix@hotmail.com
>
> right it's legal - but it's so rare that it is usually a mistake, which
> is why most c compilers will generate a warning for it. would have
> saved me a good 30 minutes tonight spent searching for the cause of a
> bug... :(
>
> -benjamin
>
> ------------------------------------------------------------------------
>
> [2002-07-07 17:41:10] sniper@php.net
>
> Not possible: if ($xx = some_function()) {} is perfectly
> legal.
>
>
> ------------------------------------------------------------------------
>
> [2002-07-07 17:40:16] sniper@php.net
>
> Thank you for taking the time to write to us, but this is not
> a bug. Please double-check the documentation available at
> http://www.php.net/manual/ and the instructions on how to
> report
> a bug at http://bugs.php.net/how-to-report.php
>
> ------------------------------------------------------------------------
>
> The remainder of the comments for this report are too long. To view
> the rest of the comments, please view the bug report online at
> http://bugs.php.net/18214
>
> --
> Edit this bug report at http://bugs.php.net/?id=18214&edit=1ÖN(%
W¼Õ
> hxB©–ö
>
---------------------------------------------------------------------------
Derick Rethans http://www.derickrethans.nl/
JDI Media Solutions http://www.jdimedia.nl/
---------------------------------------------------------------------------