Skip to content

Php Programming Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 50 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

What is a class in PHP OOP?

Show ▼

A class is a blueprint for creating objects. It defines properties (variables) and methods (functions) that the objects will have.
class User { public string $name; }

What is the difference between public, protected, and private visibility in PHP?

Show ▼

public – accessible from anywhere.
protected – accessible within the class and its subclasses.
private – accessible only within the defining class.
These are known as access modifiers.

How do you create an object from a class in PHP?

Show ▼

Use the new keyword:
$user = new User();
This calls the class constructor (__construct) if one is defined.

What is the purpose of the __construct() magic method?

Show ▼

__construct() is the constructor that runs automatically when an object is created with new.
public function __construct(public string $name) {}
It initializes object properties.

What is inheritance in PHP?

Show ▼

Inheritance lets a child class extend a parent class using the extends keyword.
class Admin extends User {}
The child inherits all public and protected properties and methods.

🎯 Take the Php Programming Practice Exam