Zend Certified Engineer Sample Questions

  1. Home
  2. Zend Certified Engineer Sample Questions
Zend Certified Engineer Sample Questions
Question 1 – In order to parse a URL into its component parts, which function should you choose?
  • A. parse_url()
  • B. url_parse(0
  • C. get_url_parts()
  • D. geturlparts()

Correct Answer: A

Question 2 – Which of the following options is NOT possible with the help of reflection?
  • A. Analysing nearly any aspect of classes and interfaces
  • B. Analysing nearly any aspect of functions
  • C. Adding class methods
  • D. Implementing the dynamic construction (new width variable class name)

Correct Answer: C

Question 3 – FILL BLANK – You are instructed by your supervisor not to let PHP scripts use PHP’s file functions to access remote HTTP and FTP resources. Which php.ini setting would you be changing accordingly?

Correct Answer: allow_url_fopen -or- allow_url_fopen=off -or- allow_url_fopen=Off -or- allow_url_fopen = off -or- allow_url_fopen = Off

Question 4 – Which of the given two options could help prevent PHP from opening a file on the hard drive? (Choose two.)
  • A. File system permissions
  • B. File is outside of open_basedir
  • C. File is inside the /tmp directory
  • D. PHP is running in CGI mode

Correct Answer: AB

Question 5 – Which of the given exception type can catch an error that is raised by the expression 2 / 0?
  • A. LogicException
  • B. RangeException
  • C. DivisionByZeroError
  • D. ArithmeticError

Correct Answer: C

Question 6 – Which function reverses the order of values in an array so that keys remain unchanged?
  • A. array_flip()
  • B. array_reverse()
  • C. rsort()
  • D. krsort()
  • E. array_multisort()

Correct Answer: B

Question 7 – Which of the following function could be used for retrieving an array of current options for a stream context?
  • A. stream_get_options()
  • B. stream_context_get_default()
  • C. stream_context_get_options()
  • D. The “˜options”™ element of the stream_get_meta_data() return value

Correct Answer: C

Question 8 – Your supervisor requests to disable user scripts that are used to dynamically load PHP extensions using the d1() function at a shared hosting provider. How would you do this? (Choose two.)
  • A. Setting enable_d1 to off in the server’s php.ini configuration file
  • B. Adding d1 to the current value of disable_functions in the server’s php.ini configuration file.
  • C. Adding d1 to the current value of disable_classes in the server’s php.ini configuration file.
  • D. Writing a custom function called d1(), saving it under the name prepend.inc, and then setting the auto_prepend_file directive to prepend.inc in php.ini.

Correct Answer: AB

Question 9 – Which of the following statements regarding SOAP are NOT true?
  • A. SOAP is also a request-/response-based protocol.
  • B. SOAP can be transported using SMTP, HTTP, and other protocols.
  • C. SOAP requires developers to use WSDL.
  • D. SOAP traffic via HTTP can be encrypted and compressed just like other HTTP requests.

Correct Answer: C

Question 10 – In which of the following situations would you be using the classes and when would you be using namespaces?
  • A. Using classes for encapsulating code and representing objects, and namespaces for avoiding symbol name collisions
  • B. Using classes for performance-sensitive code, and namespaces when readability matters more
  • C. Using namespaces for performance-sensitive code, and classes when readability matters more
  • D. Always using them; namespaces as always superior to classes

Correct Answer: A

Question 11 – To make the following code work properly, how should class MyObject be defined? 
Assume $array is an array and MyObject is a user-defined class.
  • A. MyObject should extend class Closure
  • B. MyObject should implement an interface Callable
  • C. MyObject should implement method__call
  • D. MyObject should implement method__invoke

Correct Answer: D

Question 12 – Which of the following could be used for setting a 10-second read timeout for a stream?
  • A. ini_set(“default_socket_timeout”, 10);
  • B. stream_read_timeout($stream, 10);
  • C. Specify the timeout as the 5th parameter to the fsockopen() function used to open a stream
  • D. stream_set_timeout($stream, 10);
  • E. None of the above

Correct Answer: D

Question 13 – What among the following is the possible length of a string that is returned by: md5(rand(), TRUE);
  • A. Depends on the value returned by rand() function
  • B. 32
  • C. 24
  • D. 16
  • E. 64

Correct Answer: D

Question 14 – Which of the following methods is used for overloading object properties? (Choose two.)
  • A. set(), get()
  • B. __set(), __get()
  • C. __put(), __receive(), __exist()
  • D. set(), get(), __isset()
  • E. _isset(), __unset()

Correct Answer: BE

Question 15 – FILL BLANK – Which of the given PHP function can be used for validating whether the contents of $_FILES[“name”][“tmp_name”] have been uploaded via HTTP?

Correct Answer: is_uploaded_file() -or- is_uploaded_file

Question 17 – A user-defined error handler function can handle which of these error types? (Choose two.)
  • A. E_ERROR
  • B. E_NOTICE
  • C. E_PARSE
  • D. E_WARNING

Correct Answer: AC

Question 18 – Which of the following is the most suitable difference between the spaceship operator (<=>) and the strcmp() function?
  • A. There is no difference in functionality
  • B. strcmp() returns a Boolean value, the spaceship operator a number
  • C. strcmp() does a case-intensive comparison, the spaceship operator does not
  • D. The spaceship operator returns -1, 0 or 1; strcmp() may return any integer

Correct Answer: D

Question 19 – Which of the following methods can be used for executing XPath queries in the SimpleXML extension?
  • A. xpathQuery()
  • B. xpath()
  • C. simpleXMLXpath()
  • D. query()
  • E. evaluate()

Correct Answer: B

Question 20 – Which of the following function allows the resizing of PHP”s file write buffer?
  • A. ob_start()
  • B. set_write_buffer()
  • C. stream_set_write_buffer()
  • D. Changing the output_buffering INI setting via ini_set() function

Correct Answer: C

Zend-Certified-PHP-Engineer-2
Menu