[1] https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
[1] https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
see: https://dev.mysql.com/doc/c-api/8.0/en/mysql-real-escape-str...
$arg = 'T'; $vehicle = ( ( $arg == 'B' ) ? 'bus' : ( $arg == 'A' ) ? 'airplane' : ( $arg == 'T' ) ? 'train' : ( $arg == 'C' ) ? 'car' : ( $arg == 'H' ) ? 'horse' : 'feet' ); echo $vehicle;
can someone explain to me why it should print out 'horse'? (what the article above says)
on edit: oh I get it, the false of the ternary statement here is on the left so when $arg == 'T' the true does ( $arg == 'H' ) which is false, hence printing out horse.
Well there's no reason true has to come first, but it is a c-flavored language so sort of weird it doesn't.