ch4 questions Flashcards
What actual underlying values are represented by TRUE and FALSE?
True is 1 and false is NULL or nothing
What are the simplest two forms of expressions?
The simplest forms of expressions are literals (such as numbers and strings) and variables, which simply evaluate to themselves.
What is the difference between unary, binary, and ternary operators?
Unary operators take a single operand, binary take two operands, and ternary operators takes three operands
What is the best way to force your own operator precedence?
Using parenthesis
What is meant by operator associativity?
Operator associativity refers to the direction of processing (left to right or right to left).
When would you use the === (identity) operator?
You use the identity operator when you wish to bypass PHP’s automatic operand type changing (also called type casting).
Name the three conditional statement types.
The three conditional statement types are if, switch, and the ?: operator.
What command can you use to skip the current iteration of a loop and move on to the next one?
continue
Why is the for loop more powerful than a while loop?
Because the for loop supports two additional parameters to control the loop handling.
How do if and while statements interpret conditional expressions of different data types?
Most conditional expressions in if and while statements are literal (or Boolean) and therefore trigger execution when the evaluate to TRUE. Numeric expressions trigger execution when they evaluate to a nonzero value. String expressions trigger execution when they evaluate to a nonempty string. A NULL value is evaluated as false and therefore does not trigger execution.