ID: 47004 Updated by: j...@php.net Reported By: am at webhike dot de -Status: Open +Status: Bogus -Bug Type: *Programming Data Structures +Bug Type: Scripting Engine problem Operating System: XAMPP 1.6.8 PHP Version: 5.2.8 New Comment:
It's the operator presedence. For more info: http://www.php.net/manual/en/language.operators.precedence.php Previous Comments: ------------------------------------------------------------------------ [2009-01-05 01:02:00] am at webhike dot de Description: ------------ Using Short Conditionals with more lines is causing wrong results: Reproduce code: --------------- $x = 7; echo $x == 5 ? 'five' : $x == 6 ? 'six' : $x == 7 ? 'seven' : $x == 8 ? 'eight' : $x == 9 ? 'nine' : null; Actual result: -------------- Returns 'nine'. Multiline Short Conditionals fail. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47004&edit=1