Skip to main content

200-550 Real Exam Questions

Zend Certified PHP Engineer

223 questions available · Page 1 of 23

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Single choice

How many times will the function counter() be executed in the following code?

function counter($start, &$stop)
{
if ($stop > $start)
{
return;
}
counter($start--, ++$stop);
}

$start = 5;
$stop = 2;
counter($start, $stop);

  1. A

    3

  2. B

    4

  3. C

    5

  4. D

    6

Show answer and explanation

Correct answer: C

Question 2 Single choice

What is the output of the following code?

$first = "second";
$second = "first";
echo $$$first;

  1. A

    "first"

  2. B

    "second"

  3. C

    an empty string

  4. D

    an error

Show answer and explanation

Correct answer: B

Question 3 Single choice

What will the following function call print?

printf('%010.6f', 22);

  1. A

    22

  2. B

    22.00

  3. C

    022.000000

  4. D

    22.000000

Show answer and explanation

Correct answer: C

Question 4 Single choice

What is the difference between "print" and "echo"?

  1. A

    There is no difference.

  2. B

    Print has a return value, echo does not

  3. C

    Echo has a return value, print does not

  4. D

    Print buffers the output, while echo does not

  5. E

    None of the above

Show answer and explanation

Correct answer: B

Question 5 Multiple choice

Which of the following statements about exceptions is correct? (Choose 2)

  1. A

    you can only throw classes derived from Exception

  2. B

    a try block can have multiple catch blocks

  3. C

    a try block must not be followed by a catch block

  4. D

    try blocks cannot contain nested try blocks

Show answer and explanation

Correct answers: A, B

Question 6 Single choice

What is the output of the following code?

class a
{
public $val;
}

function renderVal (a $a)
{
if ($a) {
echo $a->val;
}
}

renderVal (null);

  1. A

    A syntax error in the function declaration line

  2. B

    An error, because null is not an instance of 'a'

  3. C

    Nothing, because a null value is being passed to renderVal()

  4. D

    NULL

Show answer and explanation

Correct answer: B

Question 7 Single choice

What does the__FILE__constant contain?

  1. A

    The filename of the current script.

  2. B

    The full path to the current script.

  3. C

    The URL of the request made.

  4. D

    The path to the main script.

Show answer and explanation

Correct answer: B

Question 8 Single choice

What is the name of the header used to require HTTP authentication?

  1. A

    Authorization-Required

  2. B

    WWW-Authenticate

  3. C

    HTTP-Authenticate

  4. D

    Authentication-Required

  5. E

    HTTP-Auth

Show answer and explanation

Correct answer: B

Question 9 Single choice

What SimpleXML function is used to parse a file?

  1. A

    simplexml_load_file()

  2. B

    simplexml_load_string()

  3. C

    load()

  4. D

    loadFile()

  5. E

    loadXML()

  6. F

    None of the above.

Show answer and explanation

Correct answer: A

Question 10 Single choice

What is the result of the following code?

class T
{
const A = 42 + 1;
}
echo T::A;

  1. A

    42

  2. B

    43

  3. C

    Parse error

Show answer and explanation

Correct answer: C