Zend-Technologies 200-550 Actual Free Exam Questions & Community Discussion
In the following code, which line should be changed so it outputs the number 2:
class A {
protected $x = array(); /* A */
public function getX() { /* B */
return $this->x; /* C */
}
}
$a = new A(); /* D */ array_push($a->getX(), "one"); array_push($a->getX(), "two"); echo count($a->getX());
class A {
protected $x = array(); /* A */
public function getX() { /* B */
return $this->x; /* C */
}
}
$a = new A(); /* D */ array_push($a->getX(), "one"); array_push($a->getX(), "two"); echo count($a->getX());
Correct Answer: D
Vote an answer
What is the output of the following code?
echo '1' . (print '2') + 3;
echo '1' . (print '2') + 3;
Correct Answer: E
Vote an answer
Consider the following table data and PHP code. What is the outcome?
Table data (table name "users" with primary key "id"):
id name email
1 anna [email protected]
2 betty [email protected]
3 clara [email protected]
5 sue [email protected]
PHP code (assume the PDO connection is correctly established):
$dsn = 'mysql:host=localhost;dbname=exam';
$user = 'username';
$pass = '********';
$pdo = new PDO($dsn, $user, $pass);
$cmd = "SELECT * FROM users WHERE id = :id";
$stmt = $pdo->prepare($cmd);
$id = 3;
$stmt->bindParam('id', $id);
$stmt->execute();
$stmt->bindColumn(3, $result);
$row = $stmt->fetch(PDO::FETCH_BOUND);
Table data (table name "users" with primary key "id"):
id name email
1 anna [email protected]
2 betty [email protected]
3 clara [email protected]
5 sue [email protected]
PHP code (assume the PDO connection is correctly established):
$dsn = 'mysql:host=localhost;dbname=exam';
$user = 'username';
$pass = '********';
$pdo = new PDO($dsn, $user, $pass);
$cmd = "SELECT * FROM users WHERE id = :id";
$stmt = $pdo->prepare($cmd);
$id = 3;
$stmt->bindParam('id', $id);
$stmt->execute();
$stmt->bindColumn(3, $result);
$row = $stmt->fetch(PDO::FETCH_BOUND);
Correct Answer: D
Vote an answer
Which of the following statements about SOAP is NOT true?
Correct Answer: A
Vote an answer
Assuming UTF-8 encoding, what is the value of $count?
$data = '$1A2'; $count = strlen($data);
$data = '$1A2'; $count = strlen($data);
Correct Answer: A
Vote an answer
Which of the following methods are available to limit the amount of resources available to PHP through php.ini? (Choose 2)
Correct Answer: A,C
Vote an answer
Which of the following rules must every correct XML document adhere to? (Choose 2)
Correct Answer: A,B
Vote an answer
What is the output of the following code? var_dump(boolval(-1));
Correct Answer: B
Vote an answer
What is the name of the method that can be used to provide read access to virtual properties in a class?
Correct Answer: C
Vote an answer
What is the name of the PHP function used to automatically load non-yet defined classes?
Correct Answer: C
Vote an answer
0
0
0
10
