Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Basics (Retired) PHP Operators Operators

Operators

Unary, Binary, and Ternary operators refer to how many terms an operator is applied to, not how many characters are in the operator (e.g., === is not a ternary operator, but rather a binary comparison operator, since it is applied to only two terms, $a === $b).

3 Answers

Stone Preston
Stone Preston
42,016 Points

that was my understanding as well.

unary operators have one operand such as a++ (a is the operand)

binary operators have two operands such as a + b (a and b are operands)

ternary operators have three operands such as a > b ? true : false. (a > b, true, and false are operands)

what do you think Hampton Paulk ?

Stone is exactly right. This video is misleading and should be edited to correct the multiple mistakes in it.

BTW, WTG on your 25k Treehouse points, Stone. You da man!

Vladislav Roscovan
Vladislav Roscovan
17,565 Points

If Stone is right, I am very confused, why Treehouse is not doing anything to this misslead by Hampton Paulk!