Limited-Time Offer: Enjoy 50% Savings! - Ends In 0d 00h 00m 00s Coupon code: 50OFF
Welcome to QA4Exam

Free practice questions with explanations

Zend 200-710 Dumps 2026 with Free Practice Questions and Answers

Practise for the Zend Certified Engineer exam with 15 original questions, each with an answer and explanation.

Topics: Arrays, Data Format & Types, Databases & SQL, Security and 7 more.

Includes single answer, multiple answers, order list, drag and drop and dropdown. A new question is added every 15 days.

200-710 Practice Set Details

Vendor
Zend
Exam Code
200-710
Questions On This Page
15
Exam Topics Covered
11 of 11
Question Types
5
Newest Question
New Question
Every 15 days
Full Question Set
232
Certification
Zend PHP
15 questions

Zend 200-710 Exam Questions and Answers by Topic

PHP Basics

1 practice question on this topicWhat this topic covers

Question 1

Added

Single Answer

A production team deploys a PHP application to several Linux web servers. Requests show high CPU use from repeatedly compiling the same PHP files, but the application code and request behavior must remain unchanged. The servers have limited disk space, and the team needs a standard PHP feature that caches compiled bytecode in shared memory. Which action is the best fit?

Correct answer: D

OPcache is PHP's bytecode cache and keeps compiled scripts in shared memory when enabled for the web SAPI. Sizing its shared-memory allocation for the codebase addresses capacity without changing application behavior. APCu is a user cache, not a replacement for OPcache's compiled-script cache. file_cache_only selects a disk file cache and conflicts with the shared-memory requirement, as well as the disk constraint. The realpath cache stores path resolution information, not compiled bytecode.

Functions

1 practice question on this topicWhat this topic covers

Question 2

Added

Order List

A request handler accepts an optional callback that transforms a value before a formatter receives it. The callback must retain a request-specific prefix, and the function must reject a non-callable argument before invoking it. Arrange the implementation steps in the order they must be performed.

Drag the steps into the correct order, or use the arrows.

  1. Invoke the callback with the supplied value
  2. Pass the transformed result to the formatter
  3. Capture the request-specific prefix in the closure
  4. Declare the callback parameter with an appropriate callable type
Correct answer:
  1. Declare the callback parameter with an appropriate callable type
  2. Capture the request-specific prefix in the closure
  3. Invoke the callback with the supplied value
  4. Pass the transformed result to the formatter

The function should first constrain the callback argument with a callable type declaration, so invalid values are rejected at the call boundary. The closure is then created with the request-specific prefix in its use list, preserving that value for later invocation. Once the callback and captured state are available, invoke it with the value, then pass its return value to the formatter. Formatting before the callback would format the untransformed input, and invoking before creating the closure would leave no captured request-specific state.

Data Format & Types

2 practice questions on this topicWhat this topic covers

Question 3

Added

Single Answer

An integration accepts XML from a partner and extracts a small set of known elements. The payload is untrusted, may contain a DOCTYPE, and must not trigger external resource access. The application runs PHP with SimpleXML and libxml available. The team wants a concise parser path and must ensure parser failures are handled without emitting warnings into the HTTP response. Which approach is best?

Correct answer: A

LIBXML_NONET prevents libxml from making network requests while parsing, and libxml_use_internal_errors() allows the application to handle parse failures without warnings leaking to the response. simplexml_load_string() returns false when parsing fails, which must be checked. LIBXML_NOENT substitutes entities and is unsafe for this untrusted input. LIBXML_DTDLOAD explicitly loads DTDs and does not provide the required protection. Enabling resolveExternals asks the parser to resolve external resources rather than prohibit that behavior.

Question 4

Added

Single Answer

An API must return a timestamp in ISO 8601 format with an explicit UTC offset. The application stores timestamps as DateTimeImmutable objects, and the response must not mutate an object retained by another service. Which operation should the serializer use before formatting the value?

Correct answer: D

DateTimeImmutable::setTimezone() returns a new DateTimeImmutable instance and leaves the original unchanged. Formatting the returned instance therefore produces the requested timezone representation without mutating the shared value. Calling setTimezone() and discarding its return value leaves the original timezone in effect. Constructing a mutable DateTime introduces mutation risk and does not preserve the declared immutable representation. modify() changes the represented time rather than simply expressing the same instant in another timezone.

Web Features

1 practice question on this topicWhat this topic covers

Question 5

Added

Dropdown

A legacy account page uses a PHP session cookie for authenticated users. The deployment is HTTPS-only, JavaScript does not need to read the cookie, and the team wants to set cookie restrictions before starting the session. Complete the PHP configuration calls using settings that match those requirements.

Choose the correct value for each blank.

Before session_start(), call session_set_cookie_params(["secure" => , "httponly" => , "samesite" => ]);
Correct answer:

Before session_start(), call session_set_cookie_params(["secure" => true, "httponly" => true, "samesite" => "Lax"]);

The Secure attribute limits the session cookie to HTTPS, matching the deployment. HttpOnly prevents client-side JavaScript from reading the authentication cookie, which is not needed by this page. SameSite=Lax provides a practical cross-site request restriction while allowing ordinary top-level navigation; None would permit cross-site cookie sending and requires Secure, while Unrestricted is not a valid SameSite value. These cookie parameters must be set before session_start() so they apply when PHP sends the session cookie.

Object Oriented Programming

1 practice question on this topicWhat this topic covers

Question 6

Added

Single Answer

A base class provides a factory method that creates an instance of the class on which the method was called. A subclass inherits the method and must receive an instance of the subclass, without overriding the factory. The method may be called statically or through an instance. Which implementation uses PHP's late static binding correctly?

Correct answer: B

new static() uses the class name resolved through late static binding, so an inherited factory creates the runtime called class, including a subclass. new self() is bound to the class where the method is defined and would create the base class. new parent() explicitly creates the parent class. $this is an object, not a class name for constructor syntax, and it is unavailable when the method is called statically.

Security

2 practice questions on this topicWhat this topic covers

Question 7

Added

Multiple Answers

A public profile endpoint accepts a user-supplied URL path and displays a short profile field retrieved from a database. The system must prevent SQL injection and reflected HTML injection; changing the database schema is not permitted. The value is intended as plain text, and the endpoint uses PDO with MySQL. Which two controls should be implemented? (Choose two.)

Correct answer: B, C

A PDO prepared statement binds the path as data rather than executable SQL syntax, addressing injection without schema changes. Since the retrieved profile value is displayed as plain text in HTML, htmlspecialchars with an explicit UTF-8 charset and appropriate quote handling encodes markup characters for that output context. FILTER_SANITIZE_STRING is not a SQL parameterization mechanism and is deprecated in modern PHP. addslashes is not a reliable SQL injection defense and does not provide context-correct HTML escaping. HTML encoding the query value does not protect SQL syntax.

Question 8

Added

Order List

A PHP application accepts uploaded CSV files for later processing. The file must be stored outside the web document root under a server-generated name, and the application must not trust the client-supplied filename or content type. Arrange the processing steps in the correct order, assuming the upload request has already been received.

Drag the steps into the correct order, or use the arrows.

  1. Generate a server-side destination name outside the document root
  2. Move the uploaded file to the validated destination
  3. Check the upload error code and confirm the temporary file is an HTTP upload
  4. Validate the file's size and expected content using server-side checks
Correct answer:
  1. Check the upload error code and confirm the temporary file is an HTTP upload
  2. Validate the file's size and expected content using server-side checks
  3. Generate a server-side destination name outside the document root
  4. Move the uploaded file to the validated destination

The upload error state and provenance should be checked before treating the temporary path as a valid HTTP upload. The application then validates size and content using server-side evidence rather than the client-supplied name or MIME type. Only after validation should it generate a destination name in storage outside the document root. move_uploaded_file() performs the final move while verifying that the source is an uploaded file. Moving first risks retaining invalid content and complicates safe cleanup.

I/O

1 practice question on this topicWhat this topic covers

Question 9

Added

Drag And Drop

A PHP service must read remote content without placing a library in front of PHP streams. It needs one setting to prevent slow remote reads from hanging indefinitely, one setting to send an HTTP request header, and one setting to open the stream for reading. Match each requirement to the appropriate PHP stream-context option or mode.

Drag each item onto its matching target. On a phone: tap an item, then tap a target.

Open the stream for reading
Add a request header to the HTTP stream
Limit the remote read duration
r mode
http header
http timeout
Correct answer:
  • Limit the remote read duration → http timeout
  • Add a request header to the HTTP stream → http header
  • Open the stream for reading → r mode

The HTTP context option named timeout controls the maximum time for the stream operation, and the HTTP header option supplies request headers. The fopen mode r opens an existing stream for reading. A timeout is not an HTTP header, and the header option does not select the stream's access mode. The r mode cannot set transport behavior or add request metadata.

Strings & Patterns

1 practice question on this topicWhat this topic covers

Question 10

Added

Single Answer

A log processor receives a single-line record with fields separated by commas. Fields may be quoted and may contain commas inside the quotes, so splitting on commas is incorrect. The input encoding is UTF-8, and the code must parse one record using PHP's standard string functions rather than a custom regular expression. Which function is the most appropriate choice?

Correct answer: D

str_getcsv() parses a CSV record and recognizes quoted fields, including delimiters embedded inside quoted values. The default CSV enclosure behavior is appropriate for the stated format, while the delimiter is explicitly set to a comma. explode() and preg_split() divide at every comma and cannot preserve a comma inside a quoted field. parse_str() parses URL-encoded query strings, not CSV records.

Databases & SQL

2 practice questions on this topicWhat this topic covers

Question 11

Added

Single Answer

A payment service uses PDO with MySQL. It must atomically insert a payment and update an account balance, and the balance update must be rejected if the account has insufficient funds. The application must remain correct under concurrent requests, and a partial result must never be committed. Which implementation strategy is best?

Correct answer: D

A transaction groups the balance change and payment record so both commit or both roll back. Locking the account row with SELECT ... FOR UPDATE inside the transaction serializes competing updates to that row, allowing the sufficiency check to use the protected balance. Reading before the transaction leaves a race window. Prepared statements prevent SQL injection but do not make multiple statements atomic. An ordinary read inside a transaction does not by itself prevent another transaction from changing the balance before the update.

Question 12

Added

Single Answer

A web application uses PDO to insert a user-selected sort direction into a report query. The table and sort column are fixed in code, while the requested direction is either ascending or descending. The developer has already parameterized all data values, but PDO cannot bind an identifier or SQL keyword as a value placeholder. Which design safely supports the requested direction?

Correct answer: B

SQL identifiers and keywords cannot be supplied through ordinary PDO value placeholders, so the safe approach is to constrain the input to a fixed allowlist of valid direction tokens and interpolate only the validated token. Binding it would make it a data value rather than SQL syntax. PDO::quote() creates a quoted string literal, not a safe ORDER BY keyword. Integer validation does not validate ASC or DESC and cannot produce the intended SQL syntax.

Arrays

2 practice questions on this topicWhat this topic covers

Question 13

Added

Single Answer

A reporting service receives an associative array whose keys are customer IDs and whose values are mutable Customer objects. The service must process each object once, preserve the original keys, and let a callback update the objects in the source array. A later stage also needs to confirm that keys were not reindexed. Which iteration approach best meets these requirements without building a second array?

Correct answer: D

A by-reference foreach value remains bound to each original array element, so mutations through it affect the source array while its associative keys remain intact. Unsetting the loop variable prevents an accidental later assignment through the lingering reference. array_map() returns a new array and its callback parameter does not provide this source-array iteration behavior. array_walk() passes values to its callback but does not use callback return values to replace elements. array_values() discards the original keys, violating the reporting requirement.

Question 14

Added

Single Answer

A library accepts an object implementing ArrayAccess and must determine whether a requested offset exists. The offset may intentionally exist with a null value. The library must distinguish that case from an absent offset and must not rely on the object's internal storage representation. Which operation expresses the required test?

Correct answer: C

For an ArrayAccess object, isset($object[$offset]) invokes offsetExists() and can ask whether the offset is considered present without inspecting the object's storage. This is the required interface-level check, including when offsetGet() would return null. array_key_exists() expects an array, not an arbitrary ArrayAccess object. Testing offsetGet() against null cannot distinguish a present null value from an absent offset. Checking that the value is non-null first defeats the stated requirement.

Error Handling

1 practice question on this topicWhat this topic covers

Question 15

Added

Multiple Answers

A batch importer runs on PHP 7 and processes independent customer records. Invalid records should be reported and skipped, but a programming error must stop the batch and reach the top-level failure handler. A vendor library may throw either an Exception or an Error. The team wants one record-level recovery boundary and does not want to catch failures that should terminate the run. Which two actions meet the requirements? (Choose two.)

Correct answer: A, C

Catching the expected validation exception at the record boundary lets the importer skip known bad input without suppressing unrelated failures. In PHP 7, both Exception and Error implement Throwable, so allowing other Throwables to propagate preserves the requirement that programming errors reach the top-level handler. Catching Throwable per record would swallow programming errors and continue. Catching Exception around the entire batch is too broad for the desired boundary and does not catch Error. Converting Errors to Exceptions is not a standard general recovery strategy and can obscure programming defects.

More Practice Questions

Get the Full Zend 200-710 Dumps as PDF and Practice Test

15 questions are free on this page and the full set has 232. It comes as a PDF and an online practice test, with 90 days of free updates.