# unusual ternary operation?

I was asked to perform this operation of ternary operator use: $test='one'; echo$test == 'one' ? 'one' : \$test == 'two' ? 'two' : 'three'; Which prints two (checked using php). I am still not sure about the logic for this. Please, can anybody tell me the logic for this.

By:

Tutor
4.9 (81)

Beginner to Intermediate Technology

## Still looking for help? Get the right answer, fast.

Get a free answer to a quick problem.
Most questions answered within 4 hours.

#### OR

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.