Exam Information
Free practice questions with explanations
Zend 200-710 Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 12
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Data Format & Types
A retail company's PHP 8.0 service consumes a SOAP web service that publishes order events. The WSDL declares a complex type for each event, and the integration must validate every incoming message against the published schema before any business logic runs, with the rejection reason logged for audit. The team must not add a third-party library, and the server has the soap extension enabled. Which approach best meets these requirements?
Correct Answer: AExplanationDOMDocument::schemaValidate() checks a document against an XSD and, with libxml error collection, exposes precise reasons for rejection, which satisfies the audit requirement with only built-in extensions. SoapClient with trace mode records traffic but performs no schema validation, so manual property checks miss type and ordering violations. SimpleXML parsing does not validate against a schema and element counting proves nothing about types. json_decode cannot process an XML SOAP envelope at all, so it is not a valid conversion path.
-
2 Question 2 Dropdown Databases & SQL
A ticketing platform runs a nightly reconciliation script using PDO against MySQL. Each seat reservation must lock the matching row so concurrent workers cannot double-book it, and the lock must be held until the surrounding transaction completes. The script must use a single transaction and must not rely on application-level file locks. Complete the statement by selecting the correct value for each blank.
Choose the correct value for each blank.
$pdo->beginTransaction(); $stmt = $pdo->prepare('SELECT status FROM seats WHERE seat_id = ? '); $stmt->execute([$seatId]); ... $pdo->();Correct Answer:$pdo->beginTransaction(); $stmt = $pdo->prepare('SELECT status FROM seats WHERE seat_id = ? FOR UPDATE'); $stmt->execute([$seatId]); ... $pdo->commit();
ExplanationAppending FOR UPDATE to a SELECT inside an InnoDB transaction takes an exclusive row lock that other transactions cannot acquire until commit, which is what prevents double-booking. LOCK IN SHARE MODE and FOR SHARE only take shared locks, so two workers could both read the seat as free and then both write. NOWAIT is a modifier that makes a locked read fail immediately rather than wait, which changes failure behaviour but is not what holds the lock. The transaction must end with commit so the lock is released once the reservation is written; rollback would discard the reservation, and beginTransaction cannot end a transaction.
-
3 Question 3 Single choice Functions
A PHP 8.1 analytics module builds a pipeline of callables that transforms a stream of event records. Each transformation must capture a configuration array at the moment it is created, and later edits to that array in the calling scope must not change the behaviour of already-created transformations. The code must remain readable and avoid global variables. Which implementation best satisfies this?
Correct Answer: BExplanationA closure declared with use ($config) copies the variable's value at the moment the closure is created, so later changes in the outer scope have no effect on it, which is exactly the snapshot behaviour required. Capturing by reference with use (&$config) makes every closure observe later edits, breaking the requirement. Named functions using global introduce global state the brief forbids and still see later changes. Arrow functions capture outer variables by value, not by reference, so the claim that they capture by reference is wrong, though their value-capture would also satisfy the snapshot need; the closure with explicit use is the clearest match for the stated design.
-
4 Question 4 Single choice Security
A healthcare startup runs a PHP 7.4 application that stores user passwords in a database column currently populated with unsalted MD5 hashes. The company must migrate to a modern algorithm with minimal user disruption, must allow the hash strength to be raised over time without a second migration, and cannot require all users to reset passwords at once. Which approach best meets these requirements?
Correct Answer: CExplanationVerifying each password at login lets the legacy MD5 value be checked without forcing resets, and storing the password_hash() output with PASSWORD_DEFAULT means PHP can upgrade the algorithm later. password_needs_rehash() signals when a stored hash should be regenerated after a cost or algorithm change, which covers the future-proofing requirement. The batch rehash fails because MD5 values cannot be rehashed without the plaintext, and a fixed bcrypt cost blocks future strength increases. An HMAC is a keyed digest rather than a password hashing function and still leaves unsalted-style weaknesses in place. Leaving old accounts on MD5 keeps the insecure data in production indefinitely.
-
5 Question 5 Dropdown Databases & SQL
A payments service inserts a debit and a credit row into a ledger table with PDO. Both rows must commit together or neither may persist, and the application must surface any failure to the caller rather than silently continuing. The engineer is completing the connection setup and the transaction block. Select the correct value for each blank.
Choose the correct value for each blank.
$pdo->setAttribute(PDO::ATTR_ERRMODE, ); $pdo->(); try { $stmt->execute([$debit]); $stmt->execute([$credit]); $pdo->(); } catch (PDOException $e) { $pdo->rollBack(); throw $e; }Correct Answer:$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->beginTransaction(); try { $stmt->execute([$debit]); $stmt->execute([$credit]); $pdo->commit(); } catch (PDOException $e) { $pdo->rollBack(); throw $e; }
ExplanationSetting ATTR_ERRMODE to PDO::ERRMODE_EXCEPTION makes failed statements throw PDOException so the catch block runs and the error reaches the caller. The transaction must be opened with beginTransaction(), and the rows are made durable only by calling commit() after both inserts succeed. Silent and warning modes would let failures pass without interrupting the rollback path. The other listed names are not PDO methods for transaction control, and flush and save are not PDO operations.
-
6 Question 6 Single choice Arrays
A reporting script builds an associative array keyed by customer ID from a result set of 2 million rows. Memory usage is near the php.ini memory_limit and the script must keep running on a shared host that cannot raise the limit. Each value is a small array of three scalar fields, and the script only needs to iterate the data once in ascending key order after building it. Which change most effectively reduces memory consumption while preserving the required behaviour?
Correct Answer: AExplanationThe data is only read once in order, so a generator avoids holding all 2 million rows in memory at the same time and works within the fixed memory_limit. Converting to objects gives little saving relative to the total volume, and the script still retains everything. array_values() discards the keys the script depends on, and ksort() also requires the whole array to exist in memory first. Casting keys to strings does not reduce the storage a hash table needs for the data.
-
7 Question 7 Multiple choice Web Features
A session-based login system for a banking portal must mitigate session fixation and hijacking. The security review found that session IDs are sometimes transmitted in URLs after a user logs in, and that a session remains valid after logout. Which TWO actions together address these findings? (Choose two.)
Correct Answer: A, EExplanationSetting use_only_cookies and turning off use_trans_sid stops session IDs from being placed in URLs, which removes the leakage path identified in the review. Calling session_regenerate_id(true) after authentication issues a new ID and deletes the old one, defeating fixation attacks. Extending the garbage collection lifetime does not end a session on logout, and storing the user agent is an easily spoofed check. session_write_close() only saves session data and does not affect ID exposure or validity.
-
8 Question 8 Single choice Functions
A middleware class must wrap a set of route handlers so that each one receives a shared logger object without that object being passed as a parameter. The handlers are defined inside a method of a Router class and must call $this->logger, which is a private property. The code runs on PHP 8.1 and must not use reflection or global variables. Which mechanism is the best fit?
Correct Answer: BExplanationA closure can capture the logger through the use clause, and Closure::bind() lets a closure access private members of the Router instance when needed. Arrow functions do capture $this automatically, but they capture outer variables by value only through automatic inference and cannot reach private members on their own, so they fall short when private access is the requirement. Static functions have no $this, so they cannot see instance properties at all. A global variable violates the no-globals constraint.
-
9 Question 9 Single choice Data Format & Types
A logistics API returns timestamps in the format 2021-03-14T09:30:00-05:00 and the integration must store all values normalised to UTC before comparing them against shipment deadlines stored in the application's default timezone of Europe/Berlin. The team is writing a conversion helper for PHP 7.4 and needs the result to preserve the instant, not merely the wall-clock time. Which implementation is correct?
Correct Answer: AExplanationThe constructor parses the offset embedded in the ISO 8601 string, so the object represents the correct instant, and setTimezone() converts that instant to UTC without changing it. createFromFormat with a format lacking the offset specifier would ignore the -05:00 and produce the wrong instant. Supplying a timezone argument to the constructor does not override an explicit offset in the string, so the result would still be correct but the explanation for it fails the stated requirement of discarding the offset. Calling date_default_timezone_set() alters process-wide state and does not convert an already-parsed instant.
-
10 Question 10 Single choice Strings & Patterns
A user registration form accepts a display name that must contain only letters, digits, spaces and hyphens, with a maximum of 40 characters. The application runs on a server where the PCRE JIT may hit a backtracking limit on pathological input, and the security team wants malicious long inputs to fail safely rather than crash the request. The developer has written a regex and needs to check the result of preg_match(). Which approach is the most robust?
Correct Answer: CExplanationA return value of 1 confirms the pattern matched, while false can indicate an error such as a backtracking or JIT limit, so checking preg_last_error() distinguishes a failed match from a failed execution. The pattern with the u modifier and \p{L} accepts legitimate non-ASCII letters, and the anchors and length bound enforce the stated rules. Treating false as valid would let malformed or attack input through. The strip_tags() approach does not enforce the character whitelist. ASCII-only validation rejects valid international names, which the stated requirement of letters implies should be allowed.
-
11 Question 11 Single choice I/O
A nightly job writes a large CSV export to a shared network directory mounted from a NAS. Downstream consumers poll the directory and sometimes read partially written files, causing parse errors. The team must guarantee that consumers only ever see complete files, using only standard PHP file functions and without changing the consumers. Which approach is best?
Correct Answer: BExplanationWriting to a temporary file in the destination directory and then renaming it is effectively atomic on the same filesystem, so consumers see either no file or the complete file. The temp file must reside on the same filesystem, because rename() across mount points fails or degrades to a copy. Locking with flock is advisory and consumers that do not take the lock will still read partial data. fflush() pushes buffers forward but does not hide an incomplete file from polling readers. Copying from the system temp directory is not atomic and can expose partial content during the copy.
-
12 Question 12 Single choice Object Oriented Programming
A plugin system loads classes from a vendor directory using a custom autoloader registered with spl_autoload_register(). The team must support both classes that implement a ShippingProvider interface and classes that use a shared LoggingTrait, and they need to verify at runtime that a given plugin class implements the interface and uses the trait before instantiating it. The solution should use only built-in reflection and not parse source files. Which approach fulfils the requirement?
Correct Answer: AExplanationclass_implements() returns the interfaces a class implements and class_uses() returns the traits used directly by the class, both accepting a class name and triggering the autoloader as needed. get_parent_class() only reports the parent class, which is unrelated to interfaces or traits. method_exists() cannot confirm that a trait was used, since trait methods are copied into the class. is_a() with a trait name does not return true, because traits are not types in the inheritance sense.
These are 12 of the 232 questions in the full 200-710 pack.
Get All 232 QuestionsGet all 232 questions & answers
Full access options for Zend 200-710
Self-study
PDF Version
- 232 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 232 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 232 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the 200-710 Exam (Zend Certified Engineer) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.