Re: Why PHP sucks - farce or is there a bit of truth?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13-10-17 09:05 PM, Tim-Hinnerk Heuer wrote:
a - b = (+a) + (-b) = (-b) + (+a)

The argument is about the ternary operator though:
#include<stdio.h>

main()
{
     int a = 1;
     printf("%s", (a == 1) ? "one" : (a == 2) ? "two" : "three");

}

in C outputs:
one

So, why is PHP different?

Why not? Both are valid interpretations. if you don't want ambiguity, clarify the expression with parenthesis (as you've shown in a subsequent post). One can't hinge the entire argument of whether PHP sucks on a right-left/left-right interpretation of the ternary operator, yet this is what you've chosen to focus on.

Let's also put things in perspective, when a language reaches an audience in the millions SOMEONE will have something to whine about... and it just so happens some people like to whine loudly like a baby with a soiled nappie.

:)

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux