200-710 Exam Questions
231 real 200-710 exam questions with expert-verified answers and explanations. Page 1 of 5.
- Question #1
What is the difference between the spaceship operator (<=>) and the strcmp() function?
- Question #2
Which of these error types may be handled by a user defined error handler function? (Choose two.)
- Question #3
What is the output of the following code? $string = 'Good luck!'; $start = 10; var_dump(substr($string, $start, $start));
- Question #4
Consider 3 PHP files that are called asynchronously via XMLHttpRequest: // s1.php session_start(); sleep(1); // s2.php session_start(); sleep(2); // s3.php session_start(); sleep(3...
- Question #5
What is the output of the following code? class Test { public $var = 1; } function addMe (Test $t) { $t->var++; } $t = new Test(); addMe($t); echo $t->var;
- Question #6
What is the benefit of using persistent database connections in PHP? (Choose two.)
- Question #7
What is the output of the following code? namespace MyNamespace; class Test { } echo Test::class;
- Question #8
What function is best suited for extracting data from a formatted string into an array?
- Question #9
What exception type will catch the error raised by the expression 2 / 0?
- Question #10
What is the output of the following code? echo '1' . (print '2') + 3;
- Question #11
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; }
- Question #12
What is "instanceof" an example of?
- Question #13
Which of the following may be used in conjunction with CASE inside a SWITCH statement?
- Question #14
What is the output of the following code? $a = 'a', $b = 'b'; echo isset($c) ? $a.$b.$c : ($c = 'c').'d';
- Question #15
Which of the following are valid identifiers? (Choose 3)
- Question #16
What super-global should be used to access information about uploaded files via a POST request?
- Question #17
What is the difference between "print" and "echo"?
- Question #18
What is the result of the following bitwise operation in PHP? 1 ^ 2
- Question #19
What is the output of the following code? echo "22" + "0.2", 23 . 1;
- Question #20
What is the output of the following code? $first = "second"; $second = "first"; echo $$$first;
- Question #21
Which of the following will set a 10 seconds read timeout for a stream?
- Question #22
What function allows resizing of PHP's file write buffer?
- Question #23
What does the __FILE__ constant contain?
- Question #24
What can prevent PHP from being able to open a file on the hard drive (Choose 2)?
- Question #25
What purpose do namespaces fulfill?
- Question #26
When would you use classes and when would you use namespaces?
- Question #27
Which of these elements can be encapsulated by namespaces and made accessible from the outside?
- Question #28
You'd like to use the class MyDBConnection that's defined in the MyGreatFramework\MyGreatDatabaseAbstractionLayer namespace, but you want to minimize "as much as possible" the leng...
- Question #29
How should you track errors on your production website?
- Question #30
What would be the output of the following code? namespace MyFramework\DB; class MyClass { static function myName() { return __METHOD__; } } print MyClass::myName();
- Question #31
Which of the following methods are available to limit the amount of resources available to PHP through php.ini? (Choose 2)
- Question #32
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:...
- Question #33
Which line of code can be used to replace the INSERT comment in order to output "hello"? class C { public $ello = 'ello'; public $j; public $m; function __construct($y) { $this->c...
- Question #34
What is the output of the following code? function z($x) { return function_ ($y) use ($x) { return str_repeat($y, $x); }; } $a = z(2); $b = z(3); echo $a(3) . $b(2);
- Question #35
What is the output of the following code? $f = function () { return "hello"; }; echo gettype($f);
- Question #36
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...
- Question #37
Which SPL class implements fixed-size storage?
- Question #38
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...
- Question #39
What is the output of the following code? class Base { protected static function whoami() { echo "Base "; } public static function whoareyou() { static::whoami(); } } public static...
- Question #40
Late static binding is used in PHP to:
- Question #41
What is the output of the following code? class Test { public function __call($name, $args) { call_user_func_array('static::' . $name . '__testName', $args); echo "$1, "; } public...
- Question #42
Which of the following tasks can be achieved by using magic methods? (Choose 3) A. Initializing or uninitializing object data B. Creating a new stream wrapper C. Creating an iterab...
- Question #43
How should class MyObject be defined for the following code to work properly? Assume $array is an array and MyObject is a user-defined class. $obj = new MyObject(); array_walk($arr...
- Question #44
Consider the following code. What change must be made to the class for the code to work as written? class Magic { protected $v = array("a" => 1, "b" => 2, "c" => 3); public functio...
- Question #45
SimpleXML provides the ability to iterate over items in an XML document, as well as access items within it as if they were object properties. When creating your own classes to acce...
- Question #46
Which of the following is used to find all PHP files under a certain directory?
- Question #47
Which PHP function is used to validate whether the contents of $_FILES['name']['tmp_name'] have really been uploaded via HTTP?
- Question #48
Which PHP function is used to validate whether the contents of $_FILES['name']['tmp_name'] have really been uploaded via HTTP, and also save the contents into another folder?
- Question #49
What is the name of the key for the element in $_FILES['name'] that contains the provisional name of the uploaded file?
- Question #50
What information can be used to reliably determine the type of an uploaded file?