Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

274 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


📄 README.md

# PHP OOP Learning Repository

## 📘 Overview
This repository is a structured, web‑runnable collection of examples demonstrating modern PHP Object‑Oriented Programming concepts.  
It is designed for clarity, modularity, and real‑world learning — and doubles as a portfolio piece showing clean architecture and progressive mastery.

Each topic is isolated in its own folder with:
- One or more PHP classes  
- A runnable `example.php`  
- A focused `README.md` explaining the concept  

Every file includes a header with file name, description, date created, and author.

---

## 🚀 How to Run

1. Clone the repository:
   ```bash
   git clone https://github.com/yourusername/php-oop-learning.git
  1. Start a local PHP server:
    php -S localhost:8000 -t public
  2. Open in your browser:
    http://localhost:8000
    

Most standalone examples can also be run directly:

php example.php

📂 Repository Structure

Core OOP Concepts

  • 01‑classes-and-objects/
  • 02‑properties-and-methods/
  • 03‑constructors/
  • 04‑inheritance/
  • 05‑interfaces/
  • 06‑abstract-classes/
  • 07‑traits/
  • 08‑namespaces-and-autoloading/
  • 09‑exceptions/

10‑design-patterns/

Classic OOP design patterns (Singleton, Factory, Strategy, Observer, etc.).

20‑23 MVC Series

  • 20‑mvc-mini-framework/ — original, simplest MVC
  • 21‑mvc-mini-framework-lite/ — adds BaseController, layout, simple router
  • 22‑mvc-mini-framework-advanced/ — namespaces, PSR‑4 autoloader, Request/Response, BaseModel
  • 23‑mvc-mini-framework-pro/ — middleware, service container, config, ORM simulation

30‑php-advanced-topics/

Traits, generators, iterators, magic methods, exceptions.

40‑php-testing/

Unit testing with PHPUnit, mocking dependencies, controller tests.

50‑php-database/

PDO basics, prepared statements, transactions, ORM simulation.

60‑php-security/

Input validation, escaping, CSRF tokens, password hashing.

70‑php-performance/

Caching, profiling, optimization techniques.

80‑php-deployment/

Environment configs (.env), Docker basics, deployment scripts.

90‑php-integrations/

JSON handling, cURL API calls, external service wrappers.

99‑custom-autoloader/

Advanced autoloader experiments (extras section).

100‑php-extras/

Bonus topics: CLI tools, reflection, attributes, async programming (Fibers).


🎯 Purpose

  • Learning progression — each folder builds on the last, showing growth in skill and architecture.
  • Recruiter‑friendly — clean structure, modular examples, clear documentation.
  • Practical showcase — demonstrates not just coding, but testing, security, performance, deployment, and integrations.

✨ Author

Created by Michael Monteith
Date scaffolded: December 2025


📜 License

MIT License — free to use, modify, and learn from.


---

About

“A structured, web‑runnable collection of modern PHP OOP examples — from core concepts and design patterns to frameworks, testing, security, performance, deployment, and integrations. Built for clarity, modularity, and recruiter‑friendly presentation.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages