Share some Zend 200-710 exam questions and answers below.
In order to create an object storage where each object would be stored only once, you may use which of the following? (Choose 2)
A. SplFixedArray
B. SplObjectStorage
C. SplString
D. spl_object_hash
E: spl_same_object
Answer: B, D
What function is best suited for extracting data from a formatted string into an array?
A. fgetcsv
B. sscanf
C. sprintf
D. strtok
Answer: C
Which of these elements can be encapsulated by namespaces and made accessible from the outside?
A. Only classes
B. Classes, functions and constants
C. Classes, functions, constants and variables
Answer: B
What is the output of the following code?
$a= 3;
switch ($a) {
}
case 1: echo 'one'; break;
case 2: echo 'two'; break;
default: echo 'four'; break;
case 3: echo 'three'; break;
A. one
B. two
C. three
D. four
Answer: C
Which SPL class implements fixed-size storage?
Answer:
SplfixedArray
Which of these error types may be handled by a user defined error handler function? {Choose two.)
A. E_ERROR
B. E_NOTICE
C. E_PARSE
D. E_WARNING
Answer: A,C
What is the result of the following bitwise operation in PHP?
1 ^ 2
A. 1
B. 3
C. 2
D. 4
E. -1
Answer: B
Consider the following code.
Which keyword should be used in the line marked with "KEYWORD" instead of "self" to make this code work as intended?
abstract class Base {
protected function _construct() {
}
public static function create() {
return new self();// KEYWORD
abstract function action();
class Item extends Base {
public function action() { echo _CLASS_;}
}
$item= ltem::create();
$item->action(); I I outputs "Item"
Answer: static
When would you use classes and when would you use namespaces?
A. Use classes to encapsulate code and represent objects, and namespaces to avoid symbol name collisions
B. Use classes for performance-sensitive code, and namespaces when readability matters more
C. Use namespaces for performance-sensitive code, and classes when readability matters more
D. Always use them; namespaces are always superior to classes
Answer: A
Late static binding is used in PHP to:
A. Load dynamic libraries and extensions at runtime
B. Use caller class information provided in static method call
C. Resolve undefined class names by automatically including needed files
D. Find proper method to call according to the call arguments
Answer: B
What is the output of the following code?
class C {
public $x = 1;
function _construct() { ++$this->x;}
function _invoke() { return ++$this->x; }
function _toString() { return (string) --$this->x;}
$obj = new C();
echo $obj();
A. 0
B. 1
C. 2
D. 3
Answer: D
Consider the following two files. When you run test.php, what would the output look like?
test.php:
include "MyString.php";
print",";
print strlen("Hello world!");
MyString.php:
namespace MyFramework\String;
function strlen($str)
{
return \strlen($str)*2; // return double the string length
}
print strlen("Hello world!")
A. 12,12
B. 12,24
C. 24,12
D. 24,24
E. PHP Fatal error: Cannot redeclare strlen()
Answer: C
What is the output of the following code?
echo "1" + 2 * "0x02";
A. 1
B. 3
C. 5
D. 20
E. 7
Answer: C
Which of the following may be used in conjunction with CASE inside a SWITCH statement?
A. A scalar
B. An expression
C. A boolean
D. All of the above
Answer: D
What is the output of the following code?
$f = function () { return "hello";};
echo gettype($f);
A. hello
B. string
C. object
D. function
Answer: C
What is the output of the following code?
class Test {
public function _call($name, $args)
{
call_user_func_array(array('static', "test$name"), $args);
}
public function testS($1) {
echo "$1,";
class Test2 extends Test {
public function testS($1) {
echo "$1,$1,";
}
$test = new Test2();
$test->S('A');
A. A,
B. A,A,
C. A,A,A,
D. PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback
Answer: B
What is the difference between "print" and "echo"?
A. There is no difference.
B. Print has a return value, echo does not
C. Echo has a return value, print does not
D. Print buffers the output, while echo does not
E: None of the above
Answer: B
Which line of code can be used to replace the INSERT comment in order to output "hello"?
class C {
public $ello == 'ello';
public $c;
public $m;
function _construct($y) {
$this->c == static function($f) {
// INSERT LINE OF CODE HERE
};
$this->m == function() {
return "h";
};
$x == new C("h");
$f == $x->c;
echo $f($x->m);
A. return $this->m() . "ello";
B. return $f() . "ello";
C. return 11h11 • $this->ello;
D. return $y. "ello";
Answer: B
What is the benefit of using persistent database connections in PHP? (Choose two.)
A. Reduces the connection & authentication overhead of connecting to the database
B. Ensures that only a single connection is open to the database from PHP
C. Allows connection settings such as character set encoding to persist
D. Allows for resumption of transactions across multiple requests.
Answer: C,D
Which of the following are valid identifiers? (Choose 3)
A. function 4You () {}
B. function_ 4You () {}
C. function object () {}
D. $1 = "Hello";
E: $ 1 = "Hello World";
Answer: B, C, E
Passcert presents the finest set of 200-710 dumps, Zend 200-710 exam questions for IT professionals to consolidate their learning and assist them pass the certification exams. Passcert is the only site that provides you the quality questions for 200-710 exam. With the help of the Passcert questions and guidance of Zend-Technologies Certification 200-710 certification exam, you can pass your Zend-Technologies 200-710 certification exam in your first attempt.
没有评论:
发表评论