Skip to main content

200-710 Real Exam Questions

Zend Certified Engineer

233 questions available · Page 1 of 24

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Multiple choice

Which of the following is true about stream contexts? (Choose 2)

  1. A

    A context can modify or enhance the behavior of a stream

  2. B

    A context indicates what session the stream is part of

  3. C

    A context is a set of parameters and stream wrapper specific options

  4. D

    Contexts are created with new Stream_Context();

Show answer and explanation

Correct answers: A, C

Question 2 Single choice

You want to parse a URL into its single parts.

Which function do you choose?

  1. A

    parse_url()

  2. B

    url_parse()

  3. C

    get_url_parts()

  4. D

    geturlparts()

Show answer and explanation

Correct answer: A

Question 3 Single choice

What is "instanceof" an example of?

  1. A

    a boolean

  2. B

    an operator

  3. C

    a function

  4. D

    a language construct

  5. E

    a class magic

Show answer and explanation

Correct answer: B

Question 4 Single choice

Given the following code, what will the output be:

trait MyTrait {

private $abc = 1;

public function increment() {

$this->abc++;

}
public function getValue() {

return $this->abc;

}

}

class MyClass {

use MyTrait;

public function incrementBy2() {

$this->increment();

$this->abc++;

}

}

$c = new MyClass;

$c->incrementBy2();

var_dump($c->getValue());

  1. A

    Fatal error: Access to private variable MyTrait::$abc from context MyClass

  2. B

    Notice: Undefined property MyClass::$abc

  3. C

    int(2)

  4. D

    int(3)

  5. E

    NULL

Show answer and explanation

Correct answer: D

Question 5 Single choice

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];

  1. A

    Nothing, this code works just fine.

  2. B

    Add__set method doing $this->v[$var] = $val

  3. C

    Rewrite__get as: public function__get(&$v)

  4. D

    Rewrite__get as: public function &__get($v)

  5. E

    Make__get method static

Show answer and explanation

Correct answer: D

Question 6 Single choice

Which of the following techniques ensures that a value submitted in a form can only be yes or no ?

  1. A

    Use a select list that only lets the user choose between yes and no .

  2. B

    Use a hidden input field that has a value of yes or no .

  3. C

    Enable the safe_mode configuration directive.

  4. D

    None of the above.

Show answer and explanation

Correct answer: D

Question 7 Fill in the blank

FILL BLANK

What is the output of the following code?

Show answer and explanation

Accepted answer: 5

Question 8 Single choice

Given a PHP value, which sample shows how to convert the value to JSON?

  1. A

    $string = json_encode($value);

  2. B

    $string = Json::encode($value);

  3. C

    $json = new Json($value); $string = $json->__toString();

  4. D

    $value = (object) $value; $string = $value->__toJson();

Show answer and explanation

Correct answer: A

Question 9 Single choice

What function is best suited for extracting data from a formatted string into an array?

  1. A

    fgetcsv

  2. B

    sscanf

  3. C

    sprintf

  4. D

    strtok

Show answer and explanation

Correct answer: C

Question 10 Fill in the blank

FILL BLANK
Consider the following code:

$result = $value1 ??? $value2;

Which operator needs to be used instead of ??? so that $result equals $value1 if $value1 evaluates to true, and equals $value2 otherwise? Just state the operator as it would be required in the code.

Show answer and explanation

Accepted answer: ?: