Bug #18214 Updated: REQUEST: WARNING ON ASSIGNMENT IN IF EXPRESSION
| From: | djanix at hotmail dot com | Date: | Sun, 07 Jul 2002 21:55:54 +0000 |
| Subject: | Bug #18214 Updated: REQUEST: WARNING ON ASSIGNMENT IN IF EXPRESSION | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13429@lists.php.net to get a copy of this message | ||
ID: 18214
Updated by: djanix@hotmail.com
Reported By: djanix@hotmail.com
Status: Bogus
Bug Type: Feature/Change Request
Operating System: any
PHP Version: 4CVS-2002-07-07
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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
------------------------------------------------------------------------
[2002-07-07 17:38:33] djanix@hotmail.com
just a quick feature request...
how about a warning for assignment inside of an expression, like most
c compilers will generate...
" if ( $a = false ) { "
would generate a warning... if u had the warning enabled of
course....
i'm surprised it doesn't already do that...
-benjamin+
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18214&edit=1