What function can reverse the order of values in an array without the loss of key information?
The XML document below has been parsed into $xml via SimpleXML. How can the value of
accessed?
Consider the following code:
strspn($test, 'aeiou', 1);
The variable $test contains the string "You get certified".
What will the function call return?
Which of the following rules must every correct XML document adhere to? (Choose 2)
What is the output of the following code?
1
2 function append($str)
3 {
4 $str = $str.'append';
5 }
6
7 function prepend(&$str)
8 {
9 $str = 'prepend'.$str;
10 }
11
12 $string = 'zce';
13 append(prepend($string));
14 echo $string;
15 ?>
You analyze the code of a colleague and see a call to the function quotemeta(). You give the string "Holy $%&[. What's going on?" as a parameter to it. What will it output?
Which of the following superglobals does not contain data from the client?
Given the following two functions, what statement is correct?
function dynamicNew($name) {
return new $name;
}
function reflectionNew($name) {
$r = new ReflectionClass($name);
return $r->newInstanceArgs();
}
Which of the following did not result in an output error in PHP 4 but does in PHP 5?
Can a private static member be accessed from a public static method of the same class?
You want to present the following formatted number: "999.000.000,00". Which function call is correct?
What piece of code would you use to obtain an array of response headers for a given URL, indexed by their respective names?
What is the name of the PHP function used to automatically load non-yet defined classes?
After executing a query on a database server, PHP offers several functions to read the resulting lines, such as mysqli_fetch_assoc, pg_fetch_row, oci_fetch,etc.). If such functions do not return any rows, it means: (Choose 2)
Given the following code, what will be the value of $a?
$a = array('a', 'b');
array_push($a, array(1, 2));
You want to run the following PHP 4 code with PHP 5. In the following example, which access modifier in PHP 5 is equivalent to "var"?
class Test {
var $tester;
}
The following form is loaded in a browser and submitted, with the checkbox activated:
What is the return value of the following code?
strpos("me myself and I", "m", 2)
What is the output of the following code?
$first = "second";
$second = "first";
echo $$$first;
You want to allow your users to submit HTML code in a form, which will then be displayed as real code and not affect your site layout. Which function do you apply to the text, when displaying it? (Choose 2)
When checking whether two English words are pronounced alike, which function should be used for the best possible result?
Which of the listed changes would you make to the following PHP 4 code in order to make it most compliant with PHP 5? (Choose 2)
class Car {
var $model;
function Car($model) {
$this->model = $model;
} function toString() {
return "I drive a $this->model.";
}}
$c = new Car('Dodge');
echo $c->toString();
?>