0

While practicing for a ZEND exam, we run into the next question:

Outcome of this code:

$var =  true ? 'while' : true ? 'till' : 'false';

The answer is 'till'... But if you run it like this:

$var =  true ? 'while' : (true ? 'till' : 'false');

The outcome is 'while' as expected.

I don't understand why the first line returns 'till'. Can anyone help me? Thanks in advance!

sanderbee
  • 694
  • 7
  • 24

0 Answers0