Zend Certified Engineer

Here you have the best Zend 200-710 practice exam questions

  • You have 38 total questions to study from
  • Each page has 5 questions, making a total of 8 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on November 17, 2024
Question 1 of 38

Consider the following two files. When you run test.php, what would the output look like?

    Correct Answer: B

    When running test.php, the included file MyString.php defines a namespaced version of the strlen function, which does not interfere with the global strlen function. Therefore, when test.php calls strlen("Hello world!"), it uses the global strlen function, producing a length of 12. In MyString.php, strlen("Hello world!") uses the namespaced strlen function which returns double the length of the string, resulting in 24. Hence, the output is 12, followed by 24.

Question 2 of 38

Youd like to use the class MyDBConnection thats defined in the MyGreatFramework\MyGreatDatabaseAbstractionLayer namespace, but you want to minimize

*as much as possible* the length of the class name you have to type. What would you do?

    Correct Answer: C

    To minimize the length of the class name you have to type as much as possible, it is best to alias MyGreatFramework\MyGreatDatabaseAbstractionLayer\MyDBConnection to a shorter name. This way, you can use the shorter alias instead of the full class name, providing the greatest reduction in length.

Question 3 of 38

What is the output of the following code?

    Correct Answer: A

    The output of the code is 'This is text'. This is because the code uses a 'heredoc' syntax in PHP, which allows the definition of multiline strings. The line $text1 = <<<‘TEXT’ $text TEXT; assigns the value of the variable $text (which is 'This is text') to $text1. Then, $text2 = <<<TEXT $text1 TEXT; assigns the value of $text1 to $text2. Finally, echo $text2; outputs 'This is text'.

Question 4 of 38

What is the output of this code?

    Correct Answer: B

    The code uses nowdoc syntax, which means the content inside TEXT will be treated as a plain string, and variables will not be parsed. Thus, the value of `$world` will not be interpolated into the string, and `hello $world` will be output literally.

Question 5 of 38

What is the output of the following code?

    Correct Answer: B

    In PHP, when an object is cast to an array, only the public properties of the object are included in the resulting array with their respective keys. Private properties are excluded. In the given code, class Bar has a private property $a and a public property $c. When the object of class Bar is cast to an array, only the public property $c will be part of the array with the key 'c'. The array will not include the private property $a. As a result, checking if the key 'a' exists in the array will return false, and checking if the key 'c' exists will return true. Therefore, the output is false-true.