ch4 questions Flashcards

1
Q

What actual underlying values are represented by TRUE and FALSE?

A

True is 1 and false is NULL or nothing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the simplest two forms of expressions?

A

The simplest forms of expressions are literals (such as numbers and strings) and variables, which simply evaluate to themselves.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between unary, binary, and ternary operators?

A

Unary operators take a single operand, binary take two operands, and ternary operators takes three operands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the best way to force your own operator precedence?

A

Using parenthesis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is meant by operator associativity?

A

Operator associativity refers to the direction of processing (left to right or right to left).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When would you use the === (identity) operator?

A

You use the identity operator when you wish to bypass PHP’s automatic operand type changing (also called type casting).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Name the three conditional statement types.

A

The three conditional statement types are if, switch, and the ?: operator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What command can you use to skip the current iteration of a loop and move on to the next one?

A

continue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why is the for loop more powerful than a while loop?

A

Because the for loop supports two additional parameters to control the loop handling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do if and while statements interpret conditional expressions of different data types?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly