docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합

이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영.

- Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들
  (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거.
- Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/
  Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/
  Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이
  존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존).
- Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/
  JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동.
- 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리.
- Topic_Programming 최종 문서 수: 2784 → 3985.
This commit is contained in:
Antigravity Agent
2026-07-05 00:39:13 +09:00
parent 9148c358d0
commit e9cbf23ab5
1356 changed files with 0 additions and 12831 deletions
@@ -0,0 +1,76 @@
---
id: php-oop-interfaces
title: "PHP OOP Interfaces"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["implements keyword", "PHP 인터페이스"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.9
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["php", "programming", "w3schools", "oop", "interfaces"]
raw_sources: ["https://www.w3schools.com/php/php_oop_interfaces.asp"]
applied_in: []
github_commit: ""
---
# [[PHP OOP Interfaces]]
## 🎯 한 줄 통찰 (One-line insight)
A class can `implements` an interface WHILE ALSO `extends`-ing another class simultaneously — this is the key structural advantage over abstract classes explicitly called out in the comparison table, since PHP only allows single class inheritance but interfaces don't consume that one inheritance slot. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`interface`** — defines a set of public methods a class MUST implement, without specifying HOW. [S1]
- **`implements`** — the keyword a class uses to fulfill an interface's contract; must implement ALL declared methods. [S1]
- **Interface vs. abstract class differences** — interfaces cannot have properties (abstract classes can); ALL interface methods must be public and are implicitly abstract (no `abstract` keyword needed); a class can implement an interface while still extending another class. [S1]
- **Polymorphism via interfaces** — multiple classes implementing the same interface can be used interchangeably. [S1]
## 📖 세부 내용 (Details)
- Basic interface: `interface Animal { public function makeSound(); } class Cat implements Animal { public function makeSound() { echo "Meow"; } } class Dog implements Animal { public function makeSound() { echo "Woff"; } }`. [S1]
- Multi-method interface: `interface Animal { public function fromFamily(); public function makeSound(); }` — both Cat and Dog must implement BOTH methods. [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **인터페이스 vs 추상 클래스의 핵심 차이**: 인터페이스는 속성을 가질 수 없고 모든 메서드가 public+abstract이며, 클래스 상속과 동시에 구현 가능하다는 점이 표로 명확히 대비됨. [S1]
## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — Cat/Dog가 동일한 Animal 인터페이스를 구현해 일관된 방식으로 다룰 수 있는 것(다형성)이 실전 활용의 대표 사례다. [S1]
## 💻 코드 패턴 (Code patterns)
Two classes implementing the same interface uniformly (PHP):
```php
interface Animal {
public function fromFamily();
public function makeSound();
}
class Cat implements Animal {
public function fromFamily() { echo "From family: Felidae.<br>"; }
public function makeSound() { echo "Sound: Meow."; }
}
class Dog implements Animal {
public function fromFamily() { echo "From family: Canidae.<br>"; }
public function makeSound() { echo "Sound: Woff."; }
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.90
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[PHP Tutorial]]
- **관련 개념:** [[PHP OOP Classes Abstract]], [[PHP OOP Traits]]
- **참조 맥락:** 다형성을 위한 메서드 계약 — 트레이트(Traits) 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — PHP OOP - Interfaces — https://www.w3schools.com/php/php_oop_interfaces.asp
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "PHP OOP Interfaces" page (Astra wiki-curation, P-Reinforce v3.1 format).