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

PHP Basics - Operators

Hi,

In this video lecture, the descriptions for unary, binary and ternary operators seem incorrect; shouldn't each describe the number of operands and not the number of operator symbols?

For example, the identical operator "===" is binary, because it acts upon two operands. A ternary operator has three operands "? :" where (condition) ? (true) : (false).

Which way is actually right? or does it even matter? Thanks!

3 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Robert;

Please see the recent discussion on this topic. I think Stone Preston provides a good explanation on this.

Ken

Oğulcan Girginc
Oğulcan Girginc
24,848 Points

This question was asked and answer 4 months ago, but Treehouse is still teaching something wrong? So, either Treehouse don't care or the video contains the right answer. Which one is the case?

Chris Komaroff
Chris Komaroff
Courses Plus Student 14,198 Points

Yes, they need to fix this video, but until then this questions is answered here.

Chris Komaroff
PLUS
Chris Komaroff
Courses Plus Student 14,198 Points

Yes, the number of operands. But maybe there are professionals out there who see it differently. But most textbooks refer to number of operands.