FILL BLANK Which PHP function is used to validate whether the contents of $_FILES['name']['tmp_name'] have really been uploaded via HTTP?
CORRECT TEXT
What is the output of the following code?
function increment (and$val)
{
return $val + 1;
}
$a = 1;
echo increment ($a);
echo increment ($a);
Which of the following statements about exceptions is correct? (Choose 2)
A. you can only throw classes derived from Exception
B. a try block can have multiple catch blocks
C. a try block must not be followed by a catch block
D. try blocks cannot contain nested try blocks
What information can be used to reliably determine the type of an uploaded file?
A. MIME type
B. File name extension
C. Contents of the file
Consider the following table data and PHP code. What is the outcome? Table data (table name "users" with primary key "id"):

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);
A. The database will return no rows.
B. The value of $row will be an array.
C. The value of $result will be empty.
D. The value of $result will be 'gamma@example.net'.
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()
What function is best suited for extracting data from a formatted string into an array?
A. fgetcsv
B. sscanf
C. sprintf
D. strtok
What does the __FILE__ constant contain?
A. The filename of the current script.
B. The full path to the current script.
C. The URL of the request made.
D. The path to the main script.
Which PHP function retrieves a list of HTTP headers that have been sent as part of the HTTP response or are ready to be sent?
A. header()
B. headers()
C. headers_list()
D. headers_sent()
E. getresponseheaders()
What is the output of the following code?

A. MyNamespace\Test
B. empty string
C. parse error
D. Test