This question is a bit proactive since php 7 has not yet been released. I'm curious how the spacecraft operator will be handled in the context of triple operators.
so if I have a triple expression before a space, for example:
$foo = 1;
$bar = 0;
echo 'foo is ' . ( ($foo > $bar) ? 'greater than' : ( ($foo < $bar ) ? 'less than' : 'equal to' ) ) . ' bar.';
which equivalent ternary operator uses the comparison operator? Do the trojans have any means to handle this scenario? I use ternary operators quite a lot, and I'm curious if there is a way to arrange the code in various cases where the comparison operator will make a difference.
source
share