
Master PHP from First Principles
Learn modern PHP 8.4 by building real applications from scratch.
No frameworks, no shortcuts—just deep understanding that prepares you for Laravel, Symfony, and professional development.
✓ 100% Free ✓ Self-Paced ✓ 112+ Chapters ✓ 5 Series
No credit card • No signup • Start immediately
Trusted by Developers Worldwide
112+ Chapters
Complete tutorials covering everything from basics to AI/ML and Claude integration
5 Series
From beginner basics to advanced AI/ML, Claude API, plus Python & Rails transitions
100% Free
MIT-licensed, open source, no paywalls ever
Modern PHP 8.4
Learn the latest features, syntax, and best practices
Open Source & Community-Driven
Built for developers, by developers. Contribute, fork, and learn freely on GitHub.
Why Learn PHP?

PHP powers over 75% of the web—from WordPress and Wikipedia to Facebook and Slack. Here's what makes modern PHP (8.4+) truly special:
⚡ Blazing Fast
PHP 8.4's JIT compilation rivals compiled languages — your apps will be fast, efficient, and scalable.
🛠️ Developer Joy
Rich tooling, strong typing, and modern syntax — Composer, PHPUnit, and modern IDEs provide exceptional DX.
💼 Career Ready
High demand for Laravel and Symfony developers — PHP powers some of the world's largest applications.
🎯 Framework Rich
Laravel, Symfony, and mature ecosystems — whether you want convention or flexibility, PHP has a framework for you.
🌍 Massive Community
Millions of developers, extensive documentation, and active support — the PHP community is welcoming and innovative.
🚀 Production Proven
Battle-tested with decades of optimization — PHP runs the most visited websites on the internet.
What Makes This Different?
Most PHP tutorials rush you into frameworks without teaching fundamentals. We take a radically different approach:
🏗️ Build from Scratch First
Understand how routers, databases, and MVC patterns work before using a framework. Deep understanding beats memorization every time.
✨ Modern PHP 8.4
Learn with the latest features, syntax, and best practices. No outdated examples or deprecated patterns.
🎨 Project-Based Learning
Build real applications, not just toy examples. You'll create a complete blog application from scratch.
🚀 Framework-Ready
Graduate to Laravel and Symfony with deep understanding. You'll know what's happening under the hood.
Learning Philosophy
We believe in understanding the fundamentals before using abstractions. By building your own router, database layer, and MVC structure, you'll truly understand what frameworks do—and why they're valuable. This approach makes you a better developer, not just a framework user.
Choose Your Learning Path

| Series | Level | Duration | Outcome |
|---|---|---|---|
| PHP Basics ⭐ | Beginner | 25 chapters • 20–30 hrs | Build a complete blog application from scratch |
| AI/ML for PHP Developers | Intermediate | 25 chapters • 40–50 hrs | Build AI-powered PHP applications |
| Claude for PHP Developers | Expert | 40 chapters • 60–80 hrs | Build production-ready Claude AI applications |
| Python to Laravel | Intermediate | 11 chapters • 15–20 hrs | Transition confidently from Python to Laravel |
| Rails to Laravel | Intermediate | 11 chapters • 15–20 hrs | Transition confidently from Rails to Laravel |
⭐ = Most popular series — best for beginners
Modern PHP 8.4
All courses use PHP 8.4 — the latest stable release with property hooks, asymmetric visibility, and more. Content is regularly updated to reflect the newest features and best practices.
🎓 PHP Basics
For absolute beginners — Start your PHP journey here
A complete, beginner-friendly course that takes you from zero to building your own blog application without frameworks.
What you'll learn:
- Core language fundamentals and modern PHP 8.4 syntax
- Object-oriented programming, traits, and namespaces
- Database interaction with PDO
- Building your own HTTP router and MVC structure
- Professional standards (PSR-1, PSR-12) and Composer
- Gentle introductions to Laravel and Symfony
📊 Course Details:
- 25 chapters | 20–30 hours | Beginner level
- Prerequisites: None — just a computer and curiosity
- Outcome: Build a complete blog application from scratch
💻 What You'll Build:
// Your own MVC framework, authentication, and more
$blog = new Blog();
$blog->create($post)->withAuth($user);🤖 AI/ML for PHP Developers
For PHP developers exploring AI/ML — Build intelligent applications
Master artificial intelligence and machine learning in PHP. From basic ML concepts to deploying production AI systems.
What you'll learn:
- Machine learning fundamentals and terminology
- Building ML models in PHP
- Integrating with Python for advanced ML
- Natural language processing and computer vision
- Deploying and scaling AI-powered services
📊 Course Details:
- 25 chapters | 40–50 hours | Intermediate to Advanced
- Prerequisites: PHP Basics or equivalent experience
- Outcome: Build AI-powered PHP applications
💻 What You'll Build:
// Spam detection, recommendations, predictions
$model->train($data);
echo $model->predict($email); // "spam"🐍 Python to Laravel
For Python devs crossing into Laravel — Your skills translate beautifully
Discover how your Python skills translate beautifully to PHP and Laravel. Perfect for Django/Flask developers exploring PHP.
What you'll learn:
- Mapping Python concepts to PHP/Laravel
- Modern PHP syntax and features
- Laravel's developer experience and productivity tools
- Building REST APIs and integrations
- Testing, deployment, and DevOps practices
📊 Course Details:
- 11 chapters | 15–20 hours | Intermediate
- Prerequisites: Python web development experience (Django/Flask)
- Outcome: Confidently build Laravel applications
💻 What You'll Build:
// Familiar patterns, new syntax
Route::get('/users', [UserController::class, 'index']);
User::where('active', true)->paginate(15);💎 Rails to Laravel
For Ruby on Rails devs exploring Laravel — Familiar patterns, new syntax
Discover how your Rails skills translate beautifully to Laravel. Perfect for experienced Rails developers exploring PHP's most popular framework.
What you'll learn:
- Mapping Rails concepts to Laravel (ActiveRecord → Eloquent)
- Modern PHP syntax and features
- Laravel's developer experience and productivity tools
- Building REST APIs and testing
- When to use Laravel vs Rails
📊 Course Details:
- 11 chapters | 15–20 hours | Intermediate
- Prerequisites: Ruby on Rails web development experience
- Outcome: Confidently build Laravel applications
💻 What You'll Build:
// Familiar patterns, new syntax
Route::get('/posts', [PostController::class, 'index']);
Post::where('published', true)->orderBy('created_at')->get();🤖 Claude for PHP Developers
For expert PHP developers — Master Anthropic's Claude AI integration
Build production-ready AI applications using Claude. From your first API call to deploying sophisticated multi-agent systems.
What you'll learn:
- Claude API integration and authentication
- Tool use (function calling) and custom tools
- Vision API for image and document analysis
- RAG (Retrieval Augmented Generation) with vector databases
- Multi-agent systems and workflow orchestration
- Production deployment, security, and cost optimization
📊 Course Details:
- 40 chapters | 60–80 hours | Expert level
- Prerequisites: Expert PHP 8.4+ knowledge, Laravel/Symfony experience
- Outcome: Build production-ready Claude AI applications
💻 What You'll Build:
// Chatbots, code review assistants, documentation generators
$claude->messages()->create([
'model' => 'claude-sonnet-4-20250514',
'messages' => [['role' => 'user', 'content' => $prompt]]
]);Not Sure Where to Start?
If you're completely new to programming, start with PHP Basics. If you're an expert PHP developer wanting to integrate Claude AI, check out Claude for PHP Developers. If you know Python web development, try Python to Laravel. If you're a Rails developer, explore Rails to Laravel. Each series is independent and self-contained.
What You'll Build

By completing our courses, you'll have built:
✅ Complete Web Applications
Build real, production-ready applications from scratch, not just toy examples.
✅ Deep Understanding
Master PHP fundamentals and modern features, not just syntax memorization.
✅ Framework Knowledge
Understand how frameworks work under the hood, preparing you for Laravel and Symfony.
✅ Professional Skills
Learn testing, deployment, and best practices used in real-world development.
✅ Portfolio Projects
Create showcase-worthy projects that demonstrate your abilities to employers.
✅ Confidence
Tackle real-world PHP development with the knowledge and skills you need.
How It Works
Follow these simple steps to get the most out of your learning journey:
Setup
Start with Chapter 00: Set up your development environment with PHP 8.4, Composer, and your favorite editor.
Learn
Follow chapters sequentially: Each chapter builds on previous concepts. Don't skip—you'll miss important foundations.
Practice
Type the code yourself: Don't copy-paste. Muscle memory matters, and typing helps you understand the syntax.
Build
Do the exercises: Hands-on practice reinforces learning. Each chapter includes practical exercises to test your understanding.
Create
Build the projects: Chapters 18–19 (PHP Basics) tie everything together into a complete blog application.
Refactor
Apply best practices: Improve your code with PSR standards, proper architecture, and professional patterns.
Share
Contribute and grow: Share your projects, contribute improvements, and help others in the community.
Experiment and Explore
Each chapter includes runnable code samples in the code/ directory. Don't just read—experiment, modify, break things, and learn! That's how real developers learn.
Quick Start
Ready to dive in? Here's a 30-second test to see if PHP is installed:
# Check PHP version
php --version
# Create your first PHP file
echo '<?php echo "Hello, PHP!";' > hello.php
# Run it
php hello.phpIf that worked, you're ready! If not, Chapter 00 will help you install PHP 8.4.
Free • Self-paced • Hands-on • From zero to production-ready
Frequently Asked Questions
Do I need prior programming experience?
No! The PHP Basics series starts from absolute zero. If you can use a computer, you can learn PHP. We'll guide you through every step, from installing PHP to building your first application.
How long will it take to complete?
Most learners complete the PHP Basics series in 20–30 hours over 2–4 weeks, working at their own pace. Advanced series like AI/ML take longer (40–50 hours) due to the complexity of the topics.
Can I skip chapters?
While possible, we don't recommend it. Each chapter builds on previous concepts. If you already know a topic, skim it to ensure you're not missing anything—but don't skip entirely.
What if I get stuck?
Every chapter includes troubleshooting tips for common issues. You can also:
- Use the "Edit this page" link to report unclear explanations
- Check the GitHub discussions
- Review the code samples in the
code/directory
Is this course really free?
Yes! MIT-licensed and completely free. No paywalls, no upsells, no hidden chapters. Everything is open source and available on GitHub.
Will this prepare me for a PHP job?
This series provides the foundation. To be job-ready, you'll want to:
- Complete the PHP Basics series
- Continue with framework-specific learning (Laravel or Symfony)
- Build portfolio projects beyond the tutorials
- Contribute to open source projects
What version of PHP do I need?
PHP 8.4 is required. All code examples use modern PHP 8.4 syntax and features. We'll show you how to install it in Chapter 00 of the PHP Basics series.
What Learners Say
Ready to Start?
🎯 Begin Your PHP Journey Today
Master PHP from first principles. Build real applications. Join thousands of developers learning modern PHP.
No credit card • No signup • Start immediately • 100% free forever
Contributing
Found a typo or want to improve a chapter? Contributions are welcome!
- GitHub: dalehurley/codewithphp
- Edit this page: Use the "Edit this page" link at the bottom of any tutorial
- Report issues: Open an issue for bugs, unclear explanations, or outdated code
- Suggest improvements: We're always looking to make the content better
Open Source
This project is MIT-licensed and completely open source. Feel free to use it for learning, teaching, or reference. Fork it, improve it, share it—it's yours.
License
MIT — completely open source and free to use for learning, teaching, or reference.