Self-Test Questions in PHP Language For Beginners Part 6


1. With which operator can you test whether two values evaluate to the same result?
2. How can you test whether two values evaluate to the same result and are both of the same type?
3. What are the results of these expressions: a) TRUE xor TRUE, b) TRUE xor FALSE, c) FALSE xor TRUE, and d) FALSE xor FALSE?
4. What is the result of !(23 === '23')?
5. What single expression might you use to set the variable $bulb to the value 1 when the variable $daypart has the value 'night', and 0 when it doesn’t?
6. To what value will PHP evaluate the expression 5 * 4 + 3 / 2 + 1?
7. How can you force PHP to evaluate the expression 1 + 2 / 3 * 4 – 5 from left to right?
8. Do the math operators (+, -, *, and /) have right-to-left or left-to-right associativity?
9. Do the assignment operators have right-to-left or left-to-right associativity?
10. When using the || operator, why is it a good idea to place the most likely to be TRUE expression on the left?

Self-Test Questions in PHP Language For Beginners Part 6

No comments:

Post a Comment