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.
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);
What is the recommended method of copying data between two opened files?
Which function can NOT help prevent cross-site scripting? (Choose 2)
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);
What is the output of the following code?
$f = function () { return "hello"; };
echo gettype($f);
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);
Your public web application needs to provide access to binary files for registered users only. How would you achieve this?
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() . ',';
}
How can you determine whether a PHP script has already sent cookies to the client?
You need to escape special characters to use user input inside a regular expression. Which functions would you use? (Choose 2)
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;
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');
How can a SimpleXML object be converted to a DOM object?
What is the output of this code?
$world = 'world';
echo <<<'TEXT'
hello $world
TEXT;
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'] ?
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'] ?
What is the name of the header used to require HTTP authentication?
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);