Easter Sale Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exams65

Zend Certified PHP Engineer Question and Answers

Zend Certified PHP Engineer

Last Update May 16, 2024
Total Questions : 223

We are offering FREE 200-550 Zend exam questions. All you do is to just go and sign up. Give your details, prepare 200-550 free exam questions and then go for complete pool of Zend Certified PHP Engineer test questions that will help you more.

200-550 pdf

200-550 PDF

$35  $99.99
200-550 Engine

200-550 Testing Engine

$42  $119.99
200-550 PDF + Engine

200-550 PDF + Testing Engine

$56  $159.99
Questions 1

One common security risk is exposing error messages directly in the browser. Which PHP configuration directive can be disabled to prevent this?

Options:

A.  

html_display

B.  

error_reporting

C.  

display_errors

D.  

error_log

E.  

ignore_repeated_errors

Discussion 0
Questions 2

Which of the following is NOT possible using reflection?

Options:

A.  

Analysing of nearly any aspect of classes and interfaces

B.  

Analysing of nearly any aspect of functions

C.  

Adding class methods

D.  

Implement dynamic construction (new with variable class name)

Discussion 0
Questions 3

You need to escape special characters to use user input inside a regular expression. Which functions would you use? (Choose 2)

Options:

A.  

addslashes()

B.  

htmlentities()

C.  

preg_quote()

D.  

regex_quote()

E.  

quote_meta()

Discussion 0
Questions 4

Which of these databases is NOT supported by a PDO driver?

Options:

A.  

Microsoft SQL Server

B.  

SQLite

C.  

Microsoft Access

D.  

Berkeley DB

Discussion 0
Questions 5

What is the output of the following code?

function increment (&$val)

{

return $val + 1;

}

$a = 1;

echo increment ($a);

echo increment ($a);

Options:

Discussion 0
Questions 6

You'd like to use the class MyDBConnection that's 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?

Options:

A.  

Import the MyGreatFramework namespace

B.  

Import the MyGreatFramework\MyGreatDatabaseAbstractionLayer namespace

C.  

Alias MyGreatFramework\MyGreatDatabaseAbstractionLayer\MyDBConnection to a shorter name

D.  

Alias MyGreatFramework\MyGreatDatabaseAbstractionLayer to a shorter name

Discussion 0
Questions 7

Your public web application needs to provide access to binary files for registered users only. How would you achieve this?

Options:

A.  

Host the files on a public external file sharing service.

B.  

Redirect to the file which resides in the server's document root

C.  

Use PHP to send the file to the client, using the header() function to set appropriate HTTP headers

D.  

PHP is used for service HTML content, not binary content

Discussion 0
Questions 8

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

Options:

A.  

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

B.  

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

C.  

Enable the safe_mode configuration directive.

D.  

None of the above.

Discussion 0
Questions 9

Which of these statements about PDO is NOT true?

Options:

A.  

PDO has built-in support for Large Objects (LOBs).

B.  

Placeholders within PDO prepared statements need to be named.

C.  

When something goes wrong, PDO can throw an instance of its own exception class.

D.  

PDO does not emulate missing database features.

Discussion 0
Questions 10

What is the output of the following code?

class A {

public $a = 1;

public function __construct($a) { $this->a = $a; }

public function mul() {

return function($x) {

return $this->a*$x;

};

}

}

$a = new A(2);

$a->mul = function($x) {

return $x*$x;

};

$m = $a->mul();

echo $m(3);

Options:

A.  

9

B.  

6

C.  

0

D.  

3

Discussion 0
Questions 11

Which of the following statements is true?

Options:

A.  

All PHP database extensions support prepared statements

B.  

All PHP database extensions come with their own special helper functions to escape user data to be used in dynamic SQL queries

C.  

All PHP database extensions provide an OOP interface

D.  

All PHP database extensions appear in the output of php -m , if installed and enabled

Discussion 0
Questions 12

Which of the following statements about Reflection is correct?

Options:

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

Discussion 0
Questions 13

How can the id attribute of the 2nd baz element from the XML string below be retrieved from the SimpleXML object

found inside $xml?

One

Two

Options:

A.  

$xml->getElementById('2');

B.  

$xml->foo->bar->baz[2]['id']

C.  

$xml->foo->baz[2]['id']

D.  

$xml->foo->bar->baz[1]['id']

E.  

$xml->bar->baz[1]['id']

Discussion 0
Questions 14

Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values?

Options:

A.  

$json = new Json($jsonValue); $value = $json->decode();

B.  

$value = Json::decode($jsonValue);

C.  

$value = json_decode($jsonValue);

D.  

$value = Json::fromJson($jsonValue);

Discussion 0
Questions 15

What is the output of the following code?

function z($x) {

return function ($y) use ($x) {

return str_repeat($y, $x);

};

}

$a = z(2);

$b = z(3);

echo $a(3) . $b(2);

Options:

A.  

22333

B.  

33222

C.  

33322

D.  

222333

Discussion 0
Questions 16

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

Options:

A.  

Nothing, this code works just fine.

B.  

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

C.  

Rewrite __get as: public function __get(&$v)

D.  

Rewrite __get as: public function &__get($v)

E.  

Make __get method static

Discussion 0
Questions 17

What is the return value of the following code?

strpos("me myself and I", "m", 2)

Options:

A.  

2

B.  

3

C.  

4

D.  

0

E.  

1

Discussion 0
Questions 18

What is the name of the PHP function used to automatically load non-yet defined classes?

Options:

A.  

autoload()

B.  

__autoload()

C.  

__catch()

D.  

load()

E.  

loadClass()

Discussion 0
Questions 19

Which string will be returned by the following function call?

$test = '/etc/conf.d/wireless';

substr($test, strrpos($test, '/')); // note that strrpos() is being called, and not strpos()

Options:

A.  

""

B.  

"/wireless"

C.  

"wireless"

D.  

"/conf.d/wireless"

E.  

"/etc"

Discussion 0
Questions 20

What types of HTTP authentication are supported by PHP? (Choose 2)

Options:

A.  

Basic

B.  

Advanced

C.  

Strict

D.  

Digest

E.  

Realm

Discussion 0
Questions 21

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

Options:

Discussion 0
Questions 22

Late static binding is used in PHP to:

Options:

A.  

Load dynamic libraries and extensions at runtime

B.  

Use caller class information provided in static method call

C.  

Resolve undefined class names by automatically including needed files

D.  

Find proper method to call according to the call arguments

Discussion 0
Questions 23

Which of the following superglobals does not necessarily contain data from the client?

Options:

A.  

$_POST

B.  

$_SESSION

C.  

$_GET

D.  

$_SERVER

Discussion 0
Questions 24

Which of the following are NOT acceptable ways to create a secure password hash in PHP? (Choose 2)

Options:

A.  

md5()

B.  

hash_pbkdf2()

C.  

password_hash()

D.  

crypt()

E.  

openssl_digest()

Discussion 0
Questions 25

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

Options:

A.  

3

B.  

4

C.  

5

D.  

6

Discussion 0
Questions 26

Which DOMElement property provides a reference to the list of the element's children?

Options:

Discussion 0
Questions 27

What parsing methodology is utilized by the SimpleXML extension?

Options:

A.  

SAX

B.  

DOM

C.  

XPath

D.  

Push/Pull Approach

E.  

Expat

Discussion 0
Questions 28

Please provide the name of the super-global variable where all the information about cookies is available.

Options:

Discussion 0
Questions 29

Transactions should be used to: (Choose 2)

Options:

A.  

Prevent errors in case of a power outage or a failure in the SQL connection

B.  

Ensure that the data is properly formatted

C.  

Ensure that either all statements are performed properly, or that none of them are.

D.  

Recover from user errors

Discussion 0
Questions 30

Which of the following can be registered as entry points with a SoapServer instance (choose 2):

Options:

A.  

A single function

B.  

A single method from a class

C.  

All methods from a class

D.  

All classes defined in a script

Discussion 0
Questions 31

Given the following code, what is correct?

function f(stdClass &$x = NULL) { $x = 42; }

$z = new stdClass;

f($z);

var_dump($z);

Options:

A.  

Error: Typehints cannot be NULL

B.  

Error: Typehints cannot be references

C.  

Result is NULL

D.  

Result is object of type stdClass

E.  

Result is 42

Discussion 0
Questions 32

What method can be used to find the tag via the DOM extension?

Options:

A.  

getElementById()

B.  

getElementsByTagName()

C.  

getElementsByTagNameNS()

D.  

getElementByName()

E.  

findTag()

Discussion 0
Questions 33

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

Options:

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

Discussion 0