fork download
  1. function ternary() {
  2. $a = 2;
  3. return (
  4. $a == 1 ? 'one'
  5. : $a == 2 ? 'two'
  6. : $a == 3 ? 'three'
  7. : 'other'
  8. );
  9. }
  10.  
  11. console.log(ternary());
Success #stdin #stdout 0.05s 16568KB
stdin
Standard input is empty
stdout
two