Edit report at http://bugs.php.net/bug.php?id=16621&edit=1
ID: 16621 Updated by: j...@php.net Reported by: pete at ana dot sk Summary: different ?: operator precedence then in C -Status: Open +Status: Wont fix Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: linux PHP Version: 4.1.2 Block user comment: N Private report: N New Comment: Use parenthesis. PHP != C :) Previous Comments: ------------------------------------------------------------------------ [2002-04-15 10:28:04] pete at ana dot sk Maybe its intentional, but i think that it would be best to have some consitence with C. 1 ? "A" : 1 ? "B" : "C" return "A" in C (since ?: is associated from right to left) but it returns "B" in PHP (since its left to right). ------------------------------------------------------------------------ [2002-04-15 10:00:43] pete at ana dot sk Maybe its intentional, but i think that it would be best to have some consitence with C. 1 ? "A" : 1 ? "B" : "C" return "A" in C (since ?: is associated from right to left) but it returns "B" in PHP (since its left to right). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=16621&edit=1