每日一题(11)
上一篇 /
下一篇 2007-10-21 20:12:10
/ 个人分类:每日一题
(基础知识部分已完,下一次将开始新的章节:开发Web应用程序部分)
19.
Which of the following expressions multiply the value of the integer variable
$a by 4?
(Choose
2)
A.
$a *= pow (2, 2);
B.
$a >>= 2;
C.
$a <<= 2;
D.
$a += $a + $a;
E.
None of the above
Answer:
The correct answers are
A and C. In Answer A, the pow function is used to calculate 2 2, which
corresponds to 4. In Answer C, the left bitwise shift operator is used to shift
the value of $a by two bits to the left, which corresponds to a multiplication
by 4.
20.
How can a scrīpt come to a clean termination?
A.
When exit() is called
B.
When the execution reaches the end of the current file
C.
When PHP crashes
D.
When Apache terminates because of a system problem
Answer:
The only answer that
really fits the bill is A. A scrīpt doesn’t necessarily terminate when it reaches
the end of any file other than the main one—so the “current” file could be
externally included and not cause the scrīpt to terminate at its end. As far as
PHP and Apache crashes, they can hardly be considered “clean” ways to terminate
a scrīpt.
相关阅读:
- 每日一题(1) (chenz1117, 2007-10-08)
- 每日一题(2) (chenz1117, 2007-10-08)
- 每日一题(3) (chenz1117, 2007-10-09)
- 每日一题(4) (chenz1117, 2007-10-10)
- 每日一题(5) (chenz1117, 2007-10-13)
- 每日一题(6) (chenz1117, 2007-10-14)
- 每日一题(7) (chenz1117, 2007-10-16)
- 每日一题(8) (chenz1117, 2007-10-17)
- 每日一题(9) (chenz1117, 2007-10-18)
- 每日一题(10) (chenz1117, 2007-10-19)
导入论坛
收藏
分享给好友
管理
举报
TAG:
每日一题