Zend 200-550

Zend Certified PHP Engineer

(Page 1 out of 15)
Showing 15 of 223 Questions
Exam Version: 6.0
Question No : 1 -

Which of the following is NOT a requirement for file uploads to work?

  • A. The PHP directive file_uploads must be set to On
  • B. The form's method attribute must be set to "post"
  • C. The form must include a hidden input element with the name set to "MAX_FILE_SIZE"
  • D. The form's enctype attribute must be set to "multipart/form-data"

Answer : C



Question No : 2 -

What would be the output of the following code?
namespace MyFramework\DB;
class MyClass {
static function myName() {
return __METHOD__;
print MyClass::myName();

  • A. MyFramework\DB\myName
  • B. MyFramework\DB\MyClass\myName
  • C. MyFramework\DB\MyClass::myName
  • D. MyClass::myName

Answer : C



Question No : 3 -

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

Answer : B



Question No : 4 -

What is the output of the following code?
class Number {
private $v = 0;
public function __construct($v) { $this->v = $v; }
public function mul() {
return function ($x) { return $this->v * $x; };
$one = new Number(1);
$two = new Number(2);
$double = $two->mul()->bindTo($one);
echo $double(5);

Answer : 5



Question No : 5 -

What is the result of the following code?
class T
const A = 42 + 1;
echo T::A;

  • A. 42
  • B. 43
  • C. Parse error

Answer : C



Question No : 6 -

What is the output of the following code?
function increment (&$val)
return $val + 1;
$a = 1;
echo increment ($a);
echo increment ($a);

Answer : 22



Question No : 7 -

Which is the most efficient way to determine if a key is present in an array, assuming the
array has no NULL values?

  • A. in_array('key', array_keys($a))
  • B. isset($a['key'])
  • C. array_key_exists('key', $a)
  • D. None of the above

Answer : B



Question No : 8 -

Which PHP function is used to validate whether the contents of
$_FILES['name']['tmp_name'] have really been uploaded via HTTP?

Answer : is_uploaded_file(), is_uploaded_file



Question No : 9 -

What can prevent PHP from being able to open a file on the hard drive (Choose 2)?

  • 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.

Answer : A,B



Question No : 10 -

Which of the following statements about Reflection is correct?

  • A. Reflection is an extension that can be disabled
  • B. Reflection is a new extension present only in PHP 5.3+
  • C. Reflection only allows to reflect on built-in classes
  • D. Built-in classes can be reflected on command line using php --rc <classname>

Answer : D



Question No : 11 -

Which of the following methods are available to limit the amount of resources available to
PHP through php.ini? (Choose 2)

  • A. Limit the amount of memory a script can consume
  • B. Limit the total amount of memory PHP uses on the entire server
  • C. Limit the maximum execution time of a script
  • D. Limit the maximum number of concurrent PHP processes
  • E. Limit the maximum number of concurrent PHP threads

Answer : A,C



Question No : 12 -

When would you use classes and when would you use namespaces?

  • A. Use classes to encapsulate code and represent objects, and namespaces to avoid symbol name collisions
  • B. Use classes for performance-sensitive code, and namespaces when readability matters more
  • C. Use namespaces for performance-sensitive code, and classes when readability matters more
  • D. Always use them; namespaces are always superior to classes

Answer : A



Question No : 13 -

Which of the following is correct? (Choose 2)

  • A. A class can extend more than one class.
  • B. A class can implement more than one class.
  • C. A class can extend more than one interface.
  • D. A class can implement more than one interface.
  • E. An interface can extend more than one interface.
  • F. An interface can implement more than one interface.

Answer : D,E



Question No : 14 -

The constructs for(), foreach(), and each() can all be used to iterate an object if the object...

  • A. implements ArrayAccess
  • B. implements Iterator
  • C. implements Iterator and ArrayAccess
  • D. None of the above

Answer : C



Question No : 15 -

Which of these elements can be encapsulated by namespaces and made accessible from
the outside?

  • A. Only classes
  • B. Classes, functions and constants
  • C. Classes, functions, constants and variables

Answer : B



(Page 1 out of 15)
Showing of 223 Questions
Exam Version: 6.0