200-500 Exam Questions
241 real 200-500 exam questions with expert-verified answers and explanations. Page 3 of 5.
- Question #103
What is the output of the following script? 1 <?php 2 function fibonacci ($x1, $x2) 3 { 4 return $x1 + $x2; 5 } 7 $x1 = 0; 8 $x2 = 1; 10 for ($i = 0; $i < 10; $i++) { 11 echo fibon...
- Question #104
What will be the value of $b after running the following code? $a = array('c', 'b', 'a'); $b = (array)$a;
- Question #105
How can you redirect a client to another page using PHP?
- Question #106
What is the output of the following code? 1 <?php 2 $a = 'a'; $b = 'b'; 3 echo isset($c) ? $a.$b.$c : ($c = 'c').'d'; 4 ?>
- Question #107
Which is the most efficient way to determine if a key is present in an array,assuming the array has no NULL values?
- Question #108
Which 2.17of the following formats is used to describe web services?
- Question #109
What will the following code piece print? echo strtr('Apples and bananas', 'ae', 'ea')
- Question #110
How can precisely one byte be read from a file, pointed by $fp? (Choose 2)
- Question #111
Which one of the following technologies was not built into PHP before version 5?
- Question #112
What will be the output value of the following code? $array = array(1,2,3); while (list(,$v) = each($array)); var_dump(current($array));
- Question #113
Assume that you are using PHP s session management without cookies and want to make sure that session information does not get lost when redirecting the client to another URL. Whic...
- Question #114
What method can be used to find a tag with the name "foo" via the DOM extension?
- Question #115
What is the output of the following code? echo "22" + "0.2", 23 . 1;
- Question #116
Can calls to Web Services be queued natively in PHP?
- Question #117
How many array elements will be found in the return value of: split(".", "
- Question #118
How do you allow the caller to submit a variable number of arguments to a function?
- Question #119
What is the output of the following code? 1 <?php 2 function append($str) 3 { 4 $str = $str.'append'; 5 } 7 function prepend(&$str) 8 { 9 $str = 'prepend'.$str; 10 } 12 $string = '...
- Question #120
How can the line on which HTTP headers were sent inside a script be determined?
- Question #121
When you need to process the values of columns in a database, you should:
- Question #122
What visibility denies access to properties and methods outside of the class?
- Question #123
What is the name of the key pointing to the domain name in the array returned by parse_url()?
- Question #124
What is the output of the following code: echo "1" + 2 * "0x02";
- Question #125
Which of the following superglobals does not contain data from the client?
- Question #126
You are creating an application that repeatedly connects to a database to retrieve order data for invoices. All data comes from the same database. In order to preserve resources, y...
- Question #127
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 #128
Do constants have global scope or local scope?
- Question #129
You want to access the 3rd character of a string, contained in the variable $test. Which of the following possibilities work?(Choose 2)
- Question #130
In the function setcookie() what does the 3rd parameter specify?
- Question #131
You want to test if a string matches a relatively complex pattern. Which of the following functions can you use? (Choose 2)
- Question #132
Which of the following techniques ensures that a value submitted in a form can only be yes or no?
- Question #133
What is "instanceof" an example of:
- Question #134
An HTML form contains this form element: <input type="file" name="myFile" /> When this form is submitted, the following PHP code gets executed: 1 <?php 2 move_uploaded_file( 3 $_FI...
- Question #135
What will the following code print? echo addslashes('I am a <b>small</b> "HTML" string, which is \'invalid\'</u>.');
- Question #136
Which session function can help to avoid session fixation?
- Question #137
Consider the following XML code: <?xml version="1.0" encoding="utf-8"?> <books> <book id="1">PHP 5 Power Programming</book> <book id="2">Learning PHP 5</book> </books> Which of the...
- Question #138
When a transaction reports no affected rows, it means that: (Choose 2)
- Question #139
What does the chown() function do?
- Question #140
The function mysqli_affected_rows() can be used to perform which of the following actions? (Choose 2)
- Question #141
In a typical web application the most used database action is...
- Question #142
PHP's array functions such as array_values() and array_key_exists() can be used on an object if the object...
- Question #143
Is the following code piece E_STRICT compliant? final class Testing { var $test = 0; public function tester() { return "Tested!"; }}
- Question #144
Which function can help prevent cross-site scripting? (Choose 2)
- Question #145
What is the output of the following script? 1 <?php 2 function ratio ($x1 = 10, $x2) 3 { 4 if (isset ($x2)) { 5 return $x2 / $x1; 6 } 7 } 9 echo ratio (0); 10 ?>
- Question #146
What is the file locking mode that should be used when writing to a file?
- Question #147
You want to extract the pieces of a date string, which looks like this: "2005-11-02". Which of the following pieces of code will properly assign $year, $month and $day with their r...
- Question #148
Given the following array: $a = array(28, 15, 77, 43); Which function will remove the value 28 from $a?
- Question #149
What is the best way to run PHP 4 and PHP 5 side-by-side on the same Apache server?
- Question #150
What is the output of the following code? str_pad('PHP', 10, 'P', STR_PAD_BOTH);
- Question #151
What is the output of the following script? 1 <?php 2 class a 3 { 4 public $val = 10; 5 } 7 function renderVal (a $a) 8 { 9 return $a->$val; 10 } 12 renderVal (new a); 13 ?>
- Question #152
Which of the following may be used in conjunction with CASE inside a SWITCH statement?