A Trigonometric Operator Problem

  question
$a = 5;
 $b = 10;
 echo ($a) ?   ($a == 5) ?   'yay' : 'nay' : ($b == 10) ?   'excessive' : ':(';

Don’t know why the result is “excellent”? Ask the friend who knows to answer next

By modifying the numerical value, combine the results to analyze it

//#1 excessive
 $a = 5;
 $b = 10;
 echo ($a) ?   ($a == 5) ?   1 : 0 : ($b == 10) ?   'excessive' : ':(';
 
 //#2 :(
 $a = 3;
 $b = 10;
 echo ($a) ?   ($a == 5) ?   1 : 0 : ($b == 10) ?   'excessive' : ':(';
 
 
 //#3 excessive
 $a = 0;
 $b = 10;
 echo ($a) ?   ($a == 5) ?   1 : 0 : ($b == 10) ?   'excessive' : ':(';
 
 //#4 :(
 $a = 0;
 $b = 9;
 echo ($a) ?   ($a == 5) ?   1 : 0 : ($b == 10) ?   'excessive' : ':(';

Can you see that $a is executed when it is true ($a == 5)? When 1: 0 is false, $b == 10 is executed
This result returns excessive when true and returns: (

In order to facilitate reading, it is best to read at ($a == 5)? Put a bracket on 1: 0