Question 1
Which value will be assigned to the key 0 in this example?
$foo = array(true, '0' => false, false => true);
Which value will be assigned to the key 0 in this example?
$foo = array(true, '0' => false, false => true);
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 function __get($v) {
return $this->v[$v];
}
}
$m = new Magic();
$m->d[] = 4;
echo $m->d[0];
What will be the output value of the following code?
$array = array(1,2,3);
while (list(,$v) = each($array));
var_dump(current($array));
Which of the following can NOT be used to send a cookie from within a PHP application?
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++) {
echo fibonacci() . ',';
}
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 '✂✔✝';
Which class of HTTP status codes is used for redirections?
Under what condition may HTTP headers be set from PHP if there is content echoed prior to the header function being used?
What is the result of the following code?
class T
{
const A = 42 + 1;
}
echo T::A;
Assuming UTF-8 encoding, what is the value of $count?

An object can be counted with count() and sizeof() if it...
Which of the following items in the $_SERVER superglobal are important for authenticating the client when using HTTP Basic authentication? (Choose 2)
What is the output of the following code?
$a = 'a'; $b = 'b';
echo isset($c) ? $a.$b.$c : ($c = 'c').'d';
Which of the following filtering techniques prevents all cross-site scripting (XSS) vulnerabilities?
What is the method used to execute XPath queries in the SimpleXML extension?