ExamDumpster

Free 200-710 sample questions

Try these free 200-710 sample questions on PHP 7.1, each with an answer and an explanation. They cover object-oriented PHP, security, arrays and SQL. Use them to test your grasp of core PHP before you study PHP 8.4.

Try them in the simulator Same questions, with study, timed and flashcard modes.

Showing 10 of 20 free sample questions.

Question 1Choose one

What is the output of the following code?

Question 2Choose one

What is the output of the following code?

Question 3Choose one

Are PHP constants case-sensitive?

Question 4Choose one

Which of the following is NOT possible using reflection?

Question 5Choose one

When would you use classes and when would you use namespaces?

Question 6Choose one

After performing the following operations: What will be the value of $a?

Question 7Choose one

True or false: you can catch fatal errors (e.g., parse errors, out of memory errors, compilation errors) in PHP 7 using try/catch.

Question 8Choose one

What is the output of the following code?

Question 9Choose 3

Which of the following are valid code snippets? (Choose three.)

Question 10Choose one

**Case Study: E-Commerce Platform Upgrade** An e-commerce company is upgrading its platform from a legacy PHP 5.4 system to PHP 7.1. The system has a central `Product` class and several specialized product types like `Book`, `Apparel`, and `Electronic`, which all inherit from `Product`. A key task is to refactor the product comparison logic. **Current Situation:** The `Product` class has a `compare()` method that uses complex `if/else` logic to compare two products. This method has become difficult to maintain. The system also frequently crashes due to type errors, as data from the database is not always in the expected format. **Requirements:** 1. **Refactor Comparison Logic:** Replace the `compare()` method with a more modern, concise solution for use in sorting functions like `usort()`. 2. **Improve Type Safety:** All methods that interact with the database must use strict type declarations for parameters and return values. For example, a method fetching a product by ID might not find it and should indicate this in a type-safe way. 3. **Add a New Feature:** A new `Shippable` interface must be created with methods `getWeight()` and `getDimensions()`. The `Apparel` and `Electronic` classes must implement this interface, but the `Book` class (which could represent an ebook) should not. Which code snippet most effectively implements all of these requirements using PHP 7.1 features? classDiagram class Product{ +int id +string name +float price +compareTo(Product other) } class Book extends Product class Apparel extends Product class Electronic extends Product interface Shippable{ > +getWeight() : float +getDimensions() : array } Apparel ..|> Shippable Electronic ..|> Shippable

10 more free samples are waiting

Create a free account to unlock the whole 200-710 sample bank, or get full access to all 262 practice questions in the simulator.

Create account