It's not a "bug," but a "feature." :)

PHP has the inverse associativity of ?: compared to C (and every other
language). This was originally a mistake, but now "it won't be changed,"
due to historical reasons.

See some messages I had on php-dev back around the first week of January,
2001 on this topic. FWIW, I would like to change it.

-adam

On 4 Aug 2001 [EMAIL PROTECTED] wrote:

> ID: 12566
> Updated by: jeroen
> Reported By: [EMAIL PROTECTED]
> Status: Open
> Bug Type: *Programming Data Structures
> Operating System: Linux
> PHP Version: 4.0.6
> New Comment:
> 
> Confirmed in latest CVS:
> 
> ---
> echo TRUE ? 'one' : TRUE ? 'two' : 'unknown';
> => two
> ---
> echo TRUE ? 'one' : FALSE ? 'two' : 'unknown';
> => two
> ---
> This definitely is a bug, and IMO a serious one. A parse error would be acceptable 
>IMO (then use ( and )), but this isn't.
> 
> Previous Comments:


-- 
adam maccabee trachtenberg
[EMAIL PROTECTED]



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to