Summer Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: s2p65

Easiest Solution 2 Pass Your Certification Exams

200-550 Zend Certified PHP Engineer Free Practice Exam Questions (2025 Updated)

Prepare effectively for your Zend 200-550 Zend Certified PHP Engineer certification with our extensive collection of free, high-quality practice questions. Each question is designed to mirror the actual exam format and objectives, complete with comprehensive answers and detailed explanations. Our materials are regularly updated for 2025, ensuring you have the most current resources to build confidence and succeed on your first attempt.

Page: 3 / 4
Total 223 questions

Is the following code vulnerable to SQL Injection ($mysqli is an instance of the MySQLi class)?

$age = $mysqli->real_escape_string($_GET['age']);

$name = $mysqli->real_escape_string($_GET['name']);

$query = "SELECT * FROM `table` WHERE name LIKE '$name' AND age = $age";

$results = $mysqli->query($query);

A.

No, the code is fully protected from SQL Injection.

B.

Yes, because the $name variable is improperly escaped.

C.

Yes, because the $name variable and the $age variable is improperly escaped.

D.

Yes, because the $age variable is improperly escaped.

E.

Yes, because you cannot prevent SQL Injection when using MySQLi

What is the recommended method of copying data between two opened files?

A.

copy($source_file, $destination_file);

B.

copy($destination_file, $source_file);

C.

stream_copy_to_stream($source_file, $destination_file);

D.

stream_copy_to_stream($destination_file, $source_file);

E.

stream_bucket_prepend($source_file, $destination_file);

Which function can NOT help prevent cross-site scripting? (Choose 2)

A.

addslashes()

B.

htmlentities()

C.

htmlspecialchars()

D.

strip_tags()

E.

quotemeta()

Which line of code can be used to replace the INSERT comment in order to output "hello"?

class C {

public $ello = 'ello';

public $c;

public $m;

function __construct($y) {

$this->c = static function($f) {

// INSERT LINE OF CODE HERE

};

$this->m = function() {

return "h";

};

}

}

$x = new C("h");

$f = $x->c;

echo $f($x->m);

A.

return $this->m() . "ello";

B.

return $f() . "ello";

C.

return "h". $this->ello;

D.

return $y . "ello";

What is the output of the following code?

$f = function () { return "hello"; };

echo gettype($f);

A.

hello

B.

string

C.

object

D.

function

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

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

How many elements does the array $matches from the following code contain?

$str = "The cat sat on the roof of their house.";

$matches = preg_split("/(the)/i", $str, -1, PREG_SPLIT_DELIM_CAPTURE);

A.

2

B.

3

C.

4

D.

7

E.

9

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

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

What is the output of the following code?

function fibonacci (&$x1 = 0, &$x2 = 1)

{

$result = $x1 + $x2;

$x1 = $x2;

$x2 = $result;

return $result;

}

for ($i = 0; $i < 10; $i++) {

echo fibonacci() . ',';

}

A.

An error

B.

1,1,1,1,1,1,1,1,1,1,

C.

1,1,2,3,5,8,13,21,34,55,

D.

Nothing

How can you determine whether a PHP script has already sent cookies to the client?

A.

Use $_COOKIE

B.

Use the getcookie() function

C.

Use the headers_sent() function

D.

Use JavaScript to send a second HTTP request

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

A.

addslashes()

B.

htmlentities()

C.

preg_quote()

D.

regex_quote()

E.

quote_meta()

What is the output of the following code?

class test {

public $value = 0;

function test() {

$this->value = 1;

}

function __construct() {

$this->value = 2;

}

}

$object = new test();

echo $object->value;

A.

2

B.

1

C.

0

D.

3

E.

No Output, PHP will generate an error message.

Given the following DateTime objects, what can you use to compare the two dates and indicate that $date2 is the later of the two dates?

$date1 = new DateTime('2014-02-03');

$date2 = new DateTime('2014-03-02');

A.

$date2 > $date1

B.

$date2 < $date1

C.

$date1->diff($date2) < 0

D.

$date1->diff($date2) > 0

How can a SimpleXML object be converted to a DOM object?

A.

dom_import_simplexml()

B.

dom_export_simplexml()

C.

simplexml_import_dom()

D.

SimpleXML2Dom()

E.

None of the above.

What is the output of this code?

$world = 'world';

echo <<<'TEXT'

hello $world

TEXT;

A.

hello world

B.

hello $world

C.

PHP Parser error

The following form is loaded in a browser and submitted, with the checkbox activated:

In the server-side PHP code to deal with the form data, what is the value of $_POST['accept'] ?

A.

accept

B.

ok

C.

true

D.

on

The following form is loaded in a recent browser and submitted, with the second select option selected:

In the server-side PHP code to deal with the form data, what is the value of $_POST['list'] ?

A.

1

B.

2

C.

two

D.

null

What is the name of the header used to require HTTP authentication?

A.

Authorization-Required

B.

WWW-Authenticate

C.

HTTP-Authenticate

D.

Authentication-Required

E.

HTTP-Auth

What will the $array array contain at the end of this script?

function modifyArray (&$array)

{

foreach ($array as &$value)

{

$value = $value + 1;

}

$value = $value + 2;

}

$array = array (1, 2, 3);

modifyArray($array);

A.

2, 3, 4

B.

2, 3, 6

C.

4, 5, 6

D.

1, 2, 3

Page: 3 / 4
Total 223 questions
Copyright © 2014-2025 Solution2Pass. All Rights Reserved