200-500 Exam Questions
241 real 200-500 exam questions with expert-verified answers and explanations. Page 4 of 5.
- Question #153
What function is ideal for outputting contents of a static file to screen?
- Question #154
What SimpleXML function is used to parse a file?
- Question #155
Which of the following will set a 10 seconds read timeout for a stream?
- Question #156
The XML document below has been parsed into $xml via SimpleXML. How can the value of <foo> tag accessed? <?xml version='1.0'?> <document> <bar> <foo>Value</foo> </bar> </document>
- Question #157
What is the method used to execute XPath queries in the SimpleXML extension?
- Question #158
What is the return value of the following code: substr_compare("foobar", "bar", 3);
- Question #159
What is the name of the method that can be used to provide read access to virtual properties in a class?
- Question #160
What is the ideal method of copying data between two opened files?
- Question #161
Which of the following function signatures is correct if you want to have classes automatically loaded?
- Question #162
Which technique should be used to speed up joins without changing their results?
- Question #163
What XML component does the following XPath query try to match? //foo[bar/@id=5]
- Question #164
Where does the session extension store the session data by default?
- Question #165
How can the constant defined below be accessed from within PHP? class myClass { const FOO = 'BAR'; }
- Question #166
What type of class definition can be used to define multiple inheritance?
- Question #167
You have a variable $test that contains sub-strings divided by a dash ("-"). How can you put every sub-string into an array element easily?
- Question #168
Which of the following parts must a XML document have in order to be well-formed?
- Question #169
How can a PHP extension be loaded? (Choose 2)
- Question #170
What is the length of a string returned by: md5(rand(), TRUE);
- Question #171
When comparing prepared statements and regular, application-constructed SQL statements, which of the following is true?
- Question #172
Which of the following statements is true?
- Question #173
What is the result of the following code? define('PI', 3.14); class T { const PI = PI; } class Math { const PI = T::PI; } echo Math::PI;
- Question #174
What is the output of the following code? try { class MyException extends Exception {}; try { throw new MyException; } catch (Exception $e) { echo "1:"; throw $e; }c atch (MyExcept...
- Question #175
Consider the following code: strspn($test, 'aeiou', 1); The variable $test contains the string "You get certified". What will the function call return?
- Question #176
What can prevent PHP from being able to open a file on the hard drive (Choose 3)?
- Question #177
Which of the following statements about database connections are commonly true? (Choose 2)
- Question #178
Under which circumstances is the $_SESSION super-global available? (Choose 2)
- Question #179
What is the output of the following code: str_replace(array("Apple","Orange"), array("Orange","Apple"), "Oranges are orange and Apples are green");
- Question #180
Which sentence describes the following regular expression match? preg_match('/^\d*(?:\.[0-9]+)?$/', $test);
- Question #181
How can XML parsing errors be suppressed in the SimpleXML extension?
- Question #182
The constructs for(), foreach(), and each() can all be used to iterate an object if the object
- Question #183
How can the id attribute of the 2nd baz element from the XML string below be retrieved from the SimpleXML object found inside $xml? <?xml version='1.0'?> <foo> <bar> <baz id="1">On...
- Question #184
When a browser requests an image identified by an img tag, it never sends a Cookie header.
- Question #185
You need to escape special characters to use user input inside a regular expression. Which functions would you use? (Choose 2)
- Question #186
Which of the following code snippets writes the content of the file "source.txt" to "target.txt"? (Choose 3)
- Question #187
Identify the security vulnerability in the following example: 1 <?php 2 mail('[email protected]', 3 'Feddback', 4 'Here is my feedback.', 5 "From: {$_COOKIE['email']}"); 6 ?>
- Question #188
What will be the output of the following code? $a = array(0, 1, 2 => array(3, 4)); $a[3] = array(4, 5); echo count($a, 1);
- Question #189
What is the result of the following code? $a = 1; $b = "1"; var_dump($a === $b);
- Question #190
Which of the following rules must every correct XML document adhere to? (Choose 2)
- Question #191
What function can reverse the order of values in an array without the loss of key information?
- Question #192
In the following code, which class can be instantiated? 1 <?php 2 abstract class Graphics { 3 abstract function draw($im, $col); 4 } 6 abstract class Point1 extends Graphics { 7 pu...
- Question #193
What does an object based on the Active Record pattern provide?
- Question #194
What will the following function call print? printf('%010.6f', 22);
- Question #195
The following code piece should print "PHP is cool", but unexpectedly, it just prints "cool". How would you correct it? echo str_replace('PHP is a pain.', 'a pain', 'cool');
- Question #196
What is the result of the following code: class T { const A = 42 + 1; } echo T::A;
- Question #197
Which of the following code snippets is correct? (Choose 2) (a) interface Drawable { abstract function draw(); } (b) interface Point { function getX(); function getY(); } (c) inter...
- Question #198
Is the following code piece E_STRICT compliant? final class Testing { private $test; public function tester() { return "Tested!"; }}
- Question #199
The purpose of the singleton pattern is to...
- Question #200
What happens if you try to access a property whose name is defined in a parent class as private, and is not declared in the current class?
- Question #201
What is the output of the folowing code? 1 <?php 2 echo '1' . (print '2') + 3; 3 ?>
- Question #202
An object can be counted with count() and sizeof() if it