#49812 [Opn->Bgs]: Alternative syntax has a bug
| From: | colder@php.net | Date: | Thu, 08 Oct 2009 12:36:38 +0000 |
| Subject: | #49812 [Opn->Bgs]: Alternative syntax has a bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143382@lists.php.net to get a copy of this message | ||
ID: 49812
Updated by: colder@php.net
Reported By: deirathe at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: OSX, Linux, Windows
PHP Version: 5.2.11
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
This is expected, see:
http://php.net/language.operators.precedence
Previous Comments:
------------------------------------------------------------------------
[2009-10-08 12:14:48] deirathe at gmail dot com
Description:
------------
Alternative syntax for if has a bug when you do not use brackets
Reproduce code:
---------------
<?
function test($a){
return $a==1?'one':$a==2?'two':$a==3?'three':'more';
}
print(test(1).'<br/>');
print(test(2).'<br/>');
print(test(3).'<br/>');
print(test(4).'<br/>');
?>
Expected result:
----------------
one<br/>two<br/>three<br/>more<br/>
Actual result:
--------------
three<br/>three<br/>three<br/>more<br/>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49812&edit=1