What will be the output of the following code?
$ a = array(0, 1, 2 => array(3, 4));
$ a[3] = array(4, 5);
echo count($a, 1);
A. 8
B. 4
C. 5
D. None of the above
正解:A
質問 2:
How many elements does the array $matches from the following code contain?
1 <?php
2 $str = "The cat sat on the roof of their house.";
3
4 $matches = preg_split("/(the)/i", $str, -1,
PREG_SPLIT_DELIM_CAPTURE);
5 ?>
A. 4
B. 3
C. 9
D. 7
E. 2
正解:D
質問 3:
When checking whether two English words are pronounced alike, which function should be used for the best possible result?
A. levenshtein()
B. soundex()
C. metaphone()
D. similar_text()
正解:C
質問 4:
You are creating an application that generates invoices in a variety of formats, including
PDF, ODS and HTML. Each of these formats is represented as a PHP class in your application. While some of the operations can be performed on all of the different formats
(such as saving and loading), other operations may be specific to one or two of the formats
(such as setting as read only). Which design pattern should you use for this application?
A. MVC
B. Adapter
C. Factory
D. Singleton
正解:C
質問 5:
Do constants have global scope or local scope?
A. They have neither global nor local scope
B. They have local scope
C. They have global scope
D. They have both global and local scope
正解:B
質問 6:
Which of the following keywords is not new in PHP 5?
A. instanceof
B. static
C. abstract
D. implements
正解:B
質問 7:
In a typical web application the most used database action is...
A. INSERT
B. UPDATE
C. CREATE
D. ALTER
E. SELECT
正解:E
質問 8:
Which of the following statements is NOT correct?
A. Typehints can be references
B. Only methods can have type hints
C. Typehints can be optional
正解:B
質問 9:
What visibility denies access to properties and methods outside of the class?
A. const
B. protected
C. static
D. public
E. private
正解:E
饭洼** -
200-500教科書という感じが少なく読みやすさは抜群です。