200-710 Exam Questions
231 real 200-710 exam questions with expert-verified answers and explanations. Page 2 of 5.
- Question #51
Which MIME type is always sent by a client if a JPEG file is uploaded via HTTP?
- Question #52
Your application uses PHP to accept and process file uploads. It fails to upload a file that is 5 MB in size, although upload_max_filesize is set to "10M". Which of the following c...
- Question #53
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...
- Question #54
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 sigma@example....
- Question #55
QUESTION 58 Consider the following table data and PHP code. What is a possible outcome? Table data (table name "users" with primary key "id"): id name email --- ---- ----- 1 anna a...
- Question #56
QUESTION 59 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...
- Question #57
QUESTION 60 Given a PHP value, which sample shows how to convert the value to JSON?
- Question #58
QUESTION 61 Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values?
- Question #59
QUESTION 62 Which of the following PHP values may NOT be encoded to a JavaScript literal using PHP's ext/json capabilities?
- Question #60
QUESTION 63 Which of the following will NOT instantiate a DateTime object with the current timestamp?
- Question #61
QUESTION 64 Given a DateTime object that is set to the first second of the year 2014, which of the following samples will correctly return a date in the format '2014-01-01 00:00:01...
- Question #62
QUESTION 65 Given the following DateTime objects, what can you use to compare the two dates and indicate that $date2 is the later of the two dates? $date1 = new DateTime('2014-02-0...
- Question #63
QUESTION 66 Given the following DateTime object, which sample will NOT alter the date to the value '2014-02-15'? $date = new DateTime('2014-03-15');
- Question #64
QUESTION 67 Which interfaces could class C implement in order to allow each statement in the following code to work? (Choose 2) $obj = new C(); foreach ($obj as $x => $y) { echo $x...
- Question #65
QUESTION 68 What is the output of the following code? class Foo implements ArrayAccess { function offsetExists($k) { return true; } function offsetGet($k) { return 'a'; } function...
- Question #66
class Bar { private $a = 'b'; public $c = 'd'; } $x = (array) new Bar(); echo array_key_exists('a', $x) ? 'true' : 'false'; echo '-'; echo array_key_exists('c', $x) ? 'true' : 'fal...
- Question #67
QUESTION 70 What is the output of the following code? $a = array('a' => '1', 'c'); echo property_exists((object)$a, 'a') ? 'true' : 'false'; echo '-'; echo property_exists((object)...
- Question #68
QUESTION 71 Assuming UTF-8 encoding, what is the value of $count? $data = '♥1a2'; $count = strlen($data);
- Question #69
QUESTION 72 What is the output of the following code? $world = 'world'; echo <<<TEXT hello $world TEXT;
- Question #70
Given a php ini setting of default_charset = utf-8 what will the following code print in the browser? header('Content-Type: text/html; charset=iso-8859-1'); echo '✂✔✝';
- Question #71
What will the following code print out? $str = '✔ one of the following'; echo str_replace('✔', 'Check', $str);
- Question #72
What is the pattern modifier for handling UTF-8 encoded preg_* functionality?
- Question #73
What is the output of the following code? $text = 'This is text'; $text1 = <<<TEXT TEXT; $text; $text2 = <<<TEXT $text1 TEXT; echo "$text2";
- Question #74
Your public web application needs to provide access to binary files for registered users only. How would you achieve this?
- Question #75
What content-type is required when sending an HTTP POST using JavaScript to ensure that PHP can access the data?
- Question #76
From your PHP application, how can you send the same header twice, but with different values?
- Question #77
Which class of HTTP status codes is used for server error conditions?
- Question #78
Which class of HTTP status codes is used for redirections?
- Question #79
Which of the following can NOT be used to send a cookie from within a PHP application?
- Question #80
Under what condition may HTTP headers be set from PHP if there is content echoed prior to the header function being used?
- Question #81
Before the headers are sent, how can you remove a previously set header?
- Question #82
How can you determine whether a PHP script has already sent cookies to the client?
- Question #83
An HTML form has two submit buttons. After submitting the form, how can you determine with PHP which button was clicked?
- Question #84
What is the output of the following code? function append(&$str) { $str = $str.'append'; } function prepend(&$str) { $str = 'prepend'.$str; } $string = 'zce'; append(prepend($strin...
- Question #85
What is the output of the following code? function increment ($val) { $val = $val + 1; } $val = 1; increment ($val); echo $val;
- Question #86
What is the output of the following code? function increment ($val) { $_GET['m'] = (int) $_GET['m'] + 1; } $_GET['m'] = 1; echo $_GET['m'];
- Question #87
How many times will the function counter() be executed in the following code? function counter ($start, &$stop) { if ($stop > $start) { return; } counter ($start--, ++$stop); } $st...
- Question #88
How do you allow the caller to submit a variable number of arguments to a function?
- Question #89
Consider the following code snippet: { $value = $value + 1; } $value = $value + 2; { $array = array (1, 2, 3); modifyArray($array);
- Question #90
What is the output of the following code? class a { public $val; function renderVal (a $a) { if ($a) { echo $a->val; } } renderVal (null);
- Question #91
What is the output of the following code? function fibonacci (&$x1 = 0, &$x2 = 1) { $result = $x1 + $x2; $x1 = $x2; $x2 = $result; return $result; } for ($i = 0; $i < 10; $i++) { e...
- Question #92
What is the output of the following code? function ratio ($x1 = 10, $x2) { if (isset ($x2)) { return $x2 / $x1; } } echo ratio (0);
- Question #93
Which of the following is NOT a valid function declaration?
- Question #94
What is the output of the following code? function increment (&$val) { return $val + 1; } $a = 1; echo increment ($a); echo increment ($a);
- Question #95
Which of the following is true about stream contexts? (Choose 2)
- Question #96
Consider the following code. What can be said about the call to file_get_contents? $getdata = 'foo=bar'; $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-typ...
- Question #97
What function can be used to retrieve an array of current options for a stream context?
- Question #98
When retrieving data from URLs, what are valid ways to make sure all file_get_contents calls send a certain user agent string? (Choose 2)
- Question #99
What will an opcode cache ALWAYS automatically improve?
- Question #100
What is cached by an opcode cache?