You are creating an application that repeatedly connects to a database to retrieve order data for invoices. All data comes from the same database. In order to preserve resources, you have to ensure that only one database connection should be used at any time. The code also has to open as few new database connections as possible. Which design pattern should you use for this scenario?
A. MVC
B. Adapter
C. Factory
D. Singleton
正解:D
質問 2:
Consider the following XML code:
<?xml version="1.0" encoding="utf-8"?>
<books>
<book id="1">PHP 5 Power Programming</book>
<book id="2">Learning PHP 5</book>
</books>
Which of the following SimpleXML calls print the name of the second book?
(Let $xml=simplexml_load_file("books.xml");) (Choose 2)
A. echo $xml->book[1];
B. $c = $xml->children(); echo $c[1];
C. echo $xml->xpath("/books/book[@id=2]");
D. echo $xml->books->book[2];
E. echo $xml->books->book[1];
正解:A,B
質問 3:
What will be the result of the following operation?
array_combine(array("A","B","C"), array(1,2,3));
A. array("A"=>1,"B"=>2,"C"=>3)
B. array("A","B",C",1,2,3)
C. array(1,2,3)
D. array(1=>"A",2=>"B",3=>"C")
E. array(1,2,3,"A","B",C")
正解:A
質問 4:
What is the output of the following code: echo "1" + 2 * "0x02";
A. 5
B. 1
C. 3
D. 20
E. 7
正解:A
質問 5:
What is the file locking mode that should be used when writing to a file?
A. LOCK_UN
B. LOCK_EX
C. LOCK_SH
D. LOCK_NB
正解:B
質問 6:
What function is ideal for outputting contents of a static file to screen?
A. include()
B. file()
C. readfile()
D. fread()
E. file_get_contents()
F. require()
正解:C
質問 7:
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.";
4 $matches = preg_split("/(the)/i", $str, -1,
PREG_SPLIT_DELIM_CAPTURE);
5 ?>
A. 4
B. 3
C. 9
D. 7
E. 2
正解:D
質問 8:
What function is used to retrieve all available information about a symbolic link?
A. lstat()
B. fstat()
C. symlink()
D. readlink()
E. stat()
正解:A
質問 9:
What is the difference between "print" and "echo"?
A. There is no difference.
B. Print returns length of data printed and echo does not
C. Echo returns length of the data printed and print does not
D. Print buffers the output, while echo does not
E. None of the above
正解:B
1288 お客様のコメント






藤平** -
Zend-Technologiesのおかげで200-530の試験に合格いたしました、次は200-500に挑戦行きたいと思います