200-710 Exam Questions
231 real 200-710 exam questions with expert-verified answers and explanations. Page 3 of 5.
- Question #101
Which php.ini setting is usually required to use an opcode cache?
- Question #102
What is the output of the following code? var_dump (boolval (-1));
- Question #103
What is the output of the following code? var_dump (boolval ([]));
- Question #104
What is the output of the following code? var_dump (boolval (new StdClass()));
- Question #105
Consider the following code: $result = $value1 ??? $value2; Which operator needs to be used instead of ??? so that $result equals $value1 if $value1 evaluates to true, and equals $...
- Question #106
Which of the following is NOT true about PHP traits? (Choose 2)
- Question #107
Given the following code, what will the output be: trait MyTrait { private $abc = 1; public function increment() { $this->abc++; } public function getValue() { return $this->abc; }...
- Question #108
In the following code, which line should be changed so it outputs the number 2: ```php class A { protected $x = array(); /* A. */ public function getX() { /* B. */ return $this->x;...
- Question #109
What is the output of the following code? ```php class A { public $a = 1; public function __construct($a) { $this->a = $a; } public function mul() { return function ($x) { return $...
- Question #110
What is the output of the following code? ```php class Number { private $v = 0; public function __construct($v) { $this->v = $v; } public function mul() { return function ($x) { re...
- Question #111
What is the output of the following code? ```php class Number { private static $sv = 10; private $v; public function __construct($v) { $this->v = $v; } public function mul() { retu...
- Question #112
Which of the following statements about anonymous functions in PHP are NOT true? (Choose 2)
- Question #113
What will be the result of the following operation? ```php $a = array_merge([1,2,3] + [4=>1,5,6]); echo $a[2]; ```
- Question #114
Which of the following functions will allow identifying unique values inside an array?
- Question #115
When using password_hash() with the PASSWORD_DEFAULT algorithm constant, which of the following is true? (Choose 2)
- Question #116
Which of the following are NOT acceptable ways to create a secure password hash in PHP? (Choose 2)
- Question #117
What is the preferred method for preventing SQL injection?
- Question #118
Is the following code vulnerable to SQL Injection ($mysqli is an instance of the MySQLi class)? ```php $age = $mysqli->real_escape_string($_GET['age']); $name = $mysqli->real_escap...
- Question #119
Which of the following does NOT help to protect against session hijacking and fixation attacks?
- Question #120
Please provide the value of the $code variable in the following statement to set an HTTP status code that signifies that the requested resource was not found. ```php http_response_...
- Question #121
Which of the following PHP functions can be used to set the HTTP response code? (Choose 2)
- Question #122
What is the name of the header used to require HTTP authentication?
- Question #123
What types of HTTP authentication are supported by PHP? (Choose 2)
- Question #124
Which of the following items in the $_SERVER superglobal are important for authenticating the client when using HTTP Basic authentication? (Choose 2)
- Question #125
When tracking upload progress with sessions, the values of 2 INI settings are needed to determine the key in $_SESSION of the upload progress data. What are the INI settings? (Choo...
- Question #126
What is the name of the function that allows you register a set of functions that implement user- defined session handling?
- Question #127
Which of these databases is NOT supported by a PDO driver?
- Question #128
Which of these statements about PDO is NOT true?
- Question #129
What is the output of the following code? ```php class Test { public $value = 0; function test() { $this->value = 1; } function __construct() { $this->value = 2; } } $object = new...
- Question #130
Which methods can be used to overload object properties? (Choose 2)
- Question #131
What is the result of the following code? ```php class T { const A = 42 + 1; } echo T::A; ```
- Question #132
Which of the following statements is NOT true?
- Question #133
What is the result of the following code? ```php define('PI', 3.14); class T { const PI = PI; } class Math { const PI = T::PI; } echo Math::PI; ```
- Question #134
Given the following code, what is correct? ```php function f(stdClass &$x = NULL) { $x = 42; } $z = new stdClass; f($z); var_dump($z); ```
- Question #135
Which of the following statements is NOT correct?
- Question #136
Which of the following statements is correct?
- Question #137
Which of the following statements about exceptions is correct? (Choose 2)
- Question #138
What is the output of the following code? ```php try { class MyException extends Exception {}; try { throw new MyException; } catch (Exception $e) { echo "1: "; throw $e; } catch (...
- Question #139
Which of the following is NOT possible using reflection?
- Question #140
What is the name of the method that can be used to provide read access to virtual properties in a class?
- Question #141
Which of the following statements about Reflection are correct?
- Question #142
What is the name of the PHP function used to automatically load non-yet defined classes?
- Question #143
When a class is defined as final it:
- Question #144
Type hinting in PHP allows the identification of the following variable types: (Choose 2)
- Question #145
Which of the following code snippets is correct? (Choose 2)
- Question #146
Which of the following statements about PHP is false? (Choose 2)
- Question #147
Which of the following is correct? (Choose 2)
- Question #148
Which of the following functions are used to escape data within the context of HTML? (Choose 2)
- Question #149
In a shared hosting environment, session data can be read by PHP scripts written by any user. How can you prevent this? (Choose 2)
- Question #150
Which of the following filtering techniques prevents all cross-site scripting (XSS) vulnerabilities?