ID: 10351 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: Sun OS 5.7 PHP Version: 4.0.3pl1 New Comment:
it does execute correctly, given the relative precedence of the '<' and '?:' operators. Previous Comments: ------------------------------------------------------------------------ [2001-04-16 16:14:48] [EMAIL PROTECTED] The following statement does not execute correctly: $departmeals = $dHour < 10.5 ? $dHour < 6.0 ? "3" : "2" : $dHour < 18.0 ? "1" : "0"; No error message--it just returns the wrong result. It does execute correctly if parentheses are added: $departmeals = $dHour < 10.5 ? ($dHour < 6.0 ? "3" : "2") : ($dHour < 18.0 ? "1" : "0"); The original is not ambiguous; it should parse and execute correctly. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=10351&edit=1