가장 많이 묻는 면접 질문과 답변 & 온라인 테스트
면접 준비, 온라인 테스트, 튜토리얼, 라이브 연습을 위한 학습 플랫폼

집중 학습 경로, 모의고사, 면접 준비 콘텐츠로 실력을 키우세요.

WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.

Prepare Interview

모의 시험

홈페이지로 설정

이 페이지 북마크

이메일 주소 구독
/ 면접 주제 / PHP OOPs
WithoutBook LIVE Mock Interviews PHP OOPs Related interview subjects: 74

Interview Questions and Answers

Know the top PHP OOPs interview questions and answers for freshers and experienced candidates to prepare for job interviews.

Total 30 questions Interview Questions and Answers

The Best LIVE Mock Interview - You should go through before interview

Know the top PHP OOPs interview questions and answers for freshers and experienced candidates to prepare for job interviews.

Interview Questions and Answers

Search a question to view the answer.

Freshers / Beginner level questions & answers

Intermediate / 1 to 5 years experienced level questions & answers

Ques 9

What is a constructor?

A constructor is a special method in a class that is automatically called when an object is created. It is used for initializing object properties.

Example:

class MyClass {
 public function __construct() {
 echo 'Constructor called';
 } 
}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 10

Explain the 'static' keyword in PHP.

The 'static' keyword is used to declare static methods and properties. Static methods can be called without creating an instance of the class.

Example:

class MathUtility {
 public static function add($a, $b) {
 return $a + $b;
 } 
}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 11

What is method overloading?

Method overloading is the ability to define multiple methods in the same class with the same name but different parameters.

Example:

class Calculator {
 public function add($a, $b) {
 return $a + $b; 
} public function add($a, $b, $c) {
 return $a + $b + $c;
 } 
}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 12

How is method overriding achieved in PHP?

Method overriding occurs when a child class provides a specific implementation for a method that is already defined in its parent class.

Example:

class Animal {
 public function makeSound() {
 echo 'Generic Animal Sound'; 



class Dog extends Animal { 
public function makeSound() {
 echo 'Bark'; 

}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 13

What is an interface in PHP?

An interface is a collection of abstract methods. Classes that implement an interface must provide concrete implementations for all its methods.

Example:

interface Logger { 
public function logMessage($message); 


class FileLogger implements Logger { 
public function logMessage($message) { // Implementation of logMessage method } 
}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 14

What is composition in OOP?

Composition is a way of creating complex objects by combining simpler objects or classes. It involves creating relationships between objects rather than relying on inheritance.

Example:

class Engine { 
/* Engine properties and methods */ 


class Car { 
private $engine; 
public function __construct(Engine $engine) { 
$this->engine = $engine; 

}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 15

Explain the difference between private, protected, and public visibility in PHP.

Private members are only accessible within the class, protected members are accessible within the class and its subclasses, and public members are accessible from outside the class.

Example:

class Example { 
private $privateVar; 
protected $protectedVar; 
public $publicVar; 
}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 16

What is method chaining in PHP?

Method chaining is a technique where multiple methods can be called on the same object in a single line. It improves code readability and conciseness.

Example:

class Calculator { 
private $result; 
public function add($a, $b) { 
$this->result = $a + $b; 
return $this; 

public function multiply($a) { 
$this->result *= $a; 
return $this; 


$total = (new Calculator())->add(3, 5)->multiply(2)->getResult();
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 17

What is the purpose of the 'namespace' keyword in PHP?

Namespaces are used to avoid naming conflicts between classes, functions, and constants. They provide a way to organize code into logical and hierarchical structures.

Example:

namespace MyNamespace; 
class MyClass { /* class definition */ }
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments

Experienced / Expert level questions & answers

Ques 18

What is the 'final' keyword in PHP?

The 'final' keyword is used to prevent a class or method from being extended or overridden by other classes.

Example:

final class FinalClass { 
/* class definition */ 

final function finalMethod() { 
/* method definition */ 
}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 19

Explain the concept of abstract classes.

Abstract classes cannot be instantiated and may contain abstract methods, which are methods without a body. Subclasses must provide implementations for all abstract methods.

Example:

abstract class Shape { 
abstract public function calculateArea(); 


class Circle extends Shape { 
public function calculateArea() 

// Implementation for Circle's area calculation 

}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 20

What is a trait in PHP?

A trait is similar to a class but intended to group functionality in a fine-grained and consistent way. Traits are used to declare methods in a class.

Example:

trait Loggable { 
public function log($message) 
{
 echo $message; 



class User { 
use Loggable; 
}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 21

What is the difference between an abstract class and an interface?

An abstract class can have both abstract and non-abstract methods, and it can have properties. Interfaces can only have abstract methods and constants.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 22

Explain late static binding in PHP.

Late static binding allows static methods to reference the called class using the 'static' keyword. It helps resolve the class at runtime rather than at compile time.

Example:

class ParentClass { 
public static function whoAmI() { 
echo static::class; 

}

 class ChildClass extends ParentClass { } 
ChildClass::whoAmI(); // Outputs 'ChildClass'
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 23

What is the use of the 'self' keyword in PHP?

The 'self' keyword is used to refer to the current class. It is used to access static properties and methods within the class itself.

Example:

class Example { 
private static $counter = 0; 
public static function incrementCounter() { 
self::$counter++; 

}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 24

Explain the Singleton design pattern in PHP.

The Singleton pattern ensures that a class has only one instance and provides a global point of access to that instance. It involves a private constructor and a static method to get the instance.

Example:

class Singleton { 
private static $instance; 
private function __construct() { /* private constructor */ } public static function getInstance() { 
if (!self::$instance) { 
self::$instance = new self(); 

return self::$instance; 

}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 25

Explain the concept of dependency injection.

Dependency injection is a design pattern where the dependencies of a class are injected from the outside rather than created within the class. It promotes loose coupling and testability.

Example:

class Database { 
/* database operations */ 
}

 class UserRepository { 
private $database; 
public function __construct(Database $database) { 
$this->database = $database; 
}
 }
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 26

What is the purpose of the 'final' keyword when applied to a class method?

When a method is marked as 'final,' it cannot be overridden by subclasses. It provides a way to prevent further modification of a specific method in a class hierarchy.

Example:

class Example { 
final public function cannotOverride() { /* method implementation */ } 
}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 27

Explain the concept of the Observer design pattern.

The Observer pattern defines a one-to-many dependency between objects, where if one object changes its state, all its dependents are notified and updated automatically.

Example:

class Subject { 
private $observers = []; 
public function addObserver(Observer $observer) { 
$this->observers[] = $observer; } 
public function notifyObservers() { 
foreach ($this->observers as $observer) { $observer->update(); } } }
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 28

What is the purpose of the 'abstract' keyword in PHP?

The 'abstract' keyword is used to declare an abstract class or method. Abstract classes cannot be instantiated, and abstract methods must be implemented by the subclasses.

Example:

abstract class Shape { 
abstract public function calculateArea(); 
}
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 29

Explain the concept of late static binding and how it differs from static binding.

Late static binding allows accessing the called class using the 'static' keyword, while static binding refers to the class in which the method is defined. Late static binding is resolved at runtime.

Example:

class ParentClass { 
public static function whoAmI() { 
echo static::class; } } 

class ChildClass extends ParentClass { } 
ChildClass::whoAmI(); // Outputs 'ChildClass'
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 30

What is the purpose of the 'clone' keyword in PHP?

The 'clone' keyword is used to create a copy of an object. It performs a shallow copy by default, but the __clone() method can be implemented to customize the cloning process.

Example:

class MyClass { 
public $property; 
public function __clone() { // Additional cloning logic if needed } } 
$obj1 = new MyClass(); $obj2 = clone $obj1;
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments

Most helpful rated by users:

Copyright © 2026, WithoutBook.