What purpose do namespaces fulfill?
A. All of the above
B. Improved performance
C. Encapsulation
D. Alternative to classes
正解:C
質問 2:
Given the following code, how can we use both traits A and B in the same class? (select all that apply)
trait A { public function hello() { return "hello"; } public function world() { return "world"; }
}
trait B { public function hello() { return "Hello"; } public function person($name) { return ":$name"; }
}
A. Rename the A::hello() method to a different name using A::hello as helloA;
B. Use B::hello() instead of A 's version using use B::hello
C. Use B::hello() instead of A 's version using B::hello insteadof A
D. Rename the A::hello() method to a different name using A::hello renameto helloA;
E. None of the above (both can be used directly)
正解:C
質問 3:
What is the output of the following code?
$text = 'This is text';
$text1 = <<<'TEXT'
$text
TEXT;
$text2 = <<<TEXT
$text1
TEXT;
echo "$text2";
A. $text2
B. $text
C. $text1
D. This is text
正解:B
質問 4:
Which of the following expressions will evaluate to a random value from an array below?
$array = array("Sue","Mary","John","Anna");
A. array_rand($array);
B. shuffle($array);
C. array_values($array, ARRAY_RANDOM);
D. $array[array_rand($array)];
E. array_rand($array, 1);
正解:D
質問 5:
When a browser requests an image identified by an img tag, it never sends a Cookie header.
A. TRUE
B. FALSE
正解:B
質問 6:
Your application uses PHP to accept and process file uploads. It fails to upload a file that is 5 MB in size, although upload_max_filesize is set to "10M". Which of the following configurations could be responsible for this outcome? (Choose 2)
A. The PHP configuration option post_max_size is set to a value that is too small
B. The browser uses an incorrect encoding as part of the HTTP request sent to the server
C. The web server is using an incorrect encoding as part of the HTTP response sent to the client
D. PHP cannot process file uploads larger than 4 MB
E. The hidden form field MAX_FILE_SIZE was set to a value that is too small
正解:A,E
質問 7:
Late static binding is used in PHP to:
A. Use caller class information provided in static method call
B. Find proper method to call according to the call arguments
C. Load dynamic libraries and extensions at runtime
D. Resolve undefined class names by automatically including needed files
正解:A
Kobayashi -
Pass4Testさんほんとうにえらいです。焦っている人におすすめ 200-550試験直前の決定版だね!