Zend 200-550 - Zend Certified PHP Engineer
Which PHP function sets a cookie and URL encodes its value when sending it to the browser?
What is the result of the following code?
class T
{
const A = 42 + 1;
}
echo T::A;
Consider the following table data and PHP code, and assume that the database supports transactions. What is the outcome?
Table data (table name "users" with primary key "id"):
id name email
------- ----------- -------------------
1 anna alpha@example.com
2 betty beta@example.org
3 clara gamma@example.net
5 sue sigma@example.info
PHP code (assume the PDO connection is correctly established):
$dsn = 'mysql:host=localhost;dbname=exam';
$user = 'username';
$pass = '********';
$pdo = new PDO($dsn, $user, $pass);
try {
$pdo->exec("INSERT INTO users (id, name, email) VALUES (6, 'bill', 'delta@example.com')");
$pdo->begin();
$pdo->exec("INSERT INTO users (id, name, email) VALUES (7, 'john', 'epsilon@example.com')");
throw new Exception();
} catch (Exception $e) {
$pdo->rollBack();
}
The following form is loaded in a browser and submitted, with the checkbox activated:
In the server-side PHP code to deal with the form data, what is the value of $_POST['accept'] ?
What is the output of this code?
$world = 'world';
echo <<<'TEXT'
hello $world
TEXT;
Consider the following XML code:
Which of the following SimpleXML calls prints the name of the second book?
(Let $xml = simplexml_load_file("books.xml"); .) (Choose 2)