每日一题(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.


TAG: 每日一题

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 16523
  • 日志数: 87
  • 建立时间: 2007-09-29
  • 更新时间: 2008-04-15

RSS订阅

Open Toolbar