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-type: application/x-www-form-urlencoded', 'content' => $getdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://example.com/submit.php', false, $context);
A. A GET request will be performed on http://example.com/submit.php
B. A POST request will be performed on http://example.com/submit.php
C. An error will be displayed
Which of the following is NOT a valid function declaration?
A. function x ($x1 = array())
B. function x (A $x1)
C. function x (A $x1 = null)
D. function x ($x1 = $x2)
Which of the following is true about stream contexts? (Choose 2)
A. A context can modify or enhance the behavior of a stream
B. A context indicates what session the stream is part of
C. A context is a set of parameters and stream wrapper specific options
D. Contexts are created with new Stream_Context();
What is the output of the following code?
function fibonacci (and$x1 = 0, and$x2 = 1)
{
$result = $x1 + $x2;
$x1 = $x2;
$x2 = $result;
return $result;
}
for ($i = 0; $i < 10; $i++) {
echo fibonacci() . ',';
}
A. An error
B. 1,1,1,1,1,1,1,1,1,1,
C. 1,1,2,3,5,8,13,21,34,55,
D. Nothing
What is the output of the following code?
function ratio ($x1 = 10, $x2)
{
if (isset ($x2)) {
return $x2 / $x1;
}
}
echo ratio (0);
A. 0
B. An integer overflow error
C. A warning, because $x1 is not set
D. A warning, because $x2 is not set
E. A floating-point overflow error
F. Nothing
What will the $array array contain at the end of this script?
function modifyArray (and$array)
{
foreach ($array as and$value)
{
$value = $value + 1;
}
$value = $value + 2;
}
$array = array (1, 2, 3);
modifyArray($array);
A. 2, 3, 4
B. 2, 3, 6
C. 4, 5, 6
D. 1, 2, 3
What is the output of the following code?
class a
{
public $val;
}
function renderVal (a $a)
{
if ($a) {
echo $a->val;
}
}
renderVal (null);
A. A syntax error in the function declaration line
B. An error, because null is not an instance of 'a'
C. Nothing, because a null value is being passed to renderVal()
D. NULL
How do you allow the caller to submit a variable number of arguments to a function?
A. Using a prototype like function test(... $parameters).
B. Using a prototype like function test() and the function func_get_args() inside the function body.
C. Using a prototype like function test($parameters[]).
D. Using a prototype like function test() and the function get_variable_args() inside the function body.
E. This is not possible in PHP.
How many times will the function counter() be executed in the following code?
function counter($start, and$stop)
{
if ($stop > $start)
{
return;
}
counter($start--, ++$stop);
}
$start = 5;
$stop = 2;
counter($start, $stop);
A. 3
B. 4
C. 5
D. 6
What is the output of the following code?
function append($str)
{
$str = $str.'append';
}
function prepend(and$str)
{
$str = 'prepend'.$str;
}
$string = 'zce';
append(prepend($string));
echo $string;
A. zceappend
B. prependzceappend
C. prependzce
D. zce
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Zend exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 200-550 exam preparations and Zend certification application, do not hesitate to visit our Vcedump.com to find your solutions here.