Skip to content

What to Learn Next

Chapter 22: What to Learn Next

Objectives

By the end of this chapter, you will:

  • Understand the key areas of growth for modern PHP developers
  • Have a concrete 30-day action plan to continue your learning journey
  • Know which framework to choose based on your goals and preferences
  • Identify essential skills beyond PHP that professional developers need
  • Have a curated list of high-quality learning resources and community connections

Estimated Reading Time: ~10 minutes
Planning Time: ~15 minutes to create your personalized roadmap

Congratulations!

If you've made it this far, you have accomplished something incredible. You have gone from the absolute basics of the PHP language to building a complete, database-driven web application from scratch, following modern, professional standards. You've learned the fundamentals of procedural programming, the core principles of Object-Oriented Programming, and you've seen how all of these concepts are applied in major frameworks like Laravel and Symfony.

You now have a rock-solid foundation in PHP 8.4 and modern development practices. The journey doesn't end here, but you are more than equipped for the next stage. This final chapter will serve as a roadmap, suggesting key areas to explore as you continue to grow as a PHP developer.

Choosing Your Path: Framework Mastery

You've had a taste of Laravel and Symfony—now it's time to pick one and go deep. Don't worry about making the "wrong" choice; both are excellent, and the skills transfer. The best choice is the one that excites you enough to keep building.

If You Enjoyed Laravel's Speed and Developer Experience

Laravel's elegant syntax and comprehensive ecosystem make it the most popular PHP framework worldwide. It's ideal for rapid development and startups.

First Steps (~2–3 weeks):

  1. Install Laravel using Composer and create a fresh project.
  2. Work through Laravel Bootcamp (free, official, hands-on tutorial—takes ~6 hours).
  3. Build a small project: A task manager, personal blog, or expense tracker. The goal is to practice routing, controllers, Blade templates, and basic CRUD operations.
  4. Learn Eloquent relationships: One-to-Many (users → posts), Many-to-Many (posts ↔ tags). This is where Eloquent shines.

Next Steps (~1–2 months):

  • Authentication: Use Laravel Breeze or Jetstream to add user registration and login.
  • Queues: Learn how to defer long-running tasks (e.g., sending emails) to background workers.
  • Testing: Write your first Feature and Unit tests using PHPUnit and Laravel's testing tools.
  • Deploy: Get your application live on Laravel Forge, Ploi, or a simple VPS.

Best Resources:

If You Enjoyed Symfony's Structure and Flexibility

Symfony is known for its robustness, flexibility, and enterprise-grade architecture. It's the foundation for many other frameworks (including Laravel's core components).

First Steps (~2–3 weeks):

  1. Install Symfony using Composer and the Symfony CLI.
  2. Follow The Fast Track (free, official book—builds a complete conference application).
  3. Build a small project: A library catalog, recipe manager, or simple CMS. Focus on routes, controllers, Twig templates, and Doctrine.
  4. Learn Doctrine: Understand Entities, Repositories, and how Doctrine's Data Mapper pattern differs from Active Record.

Next Steps (~1–2 months):

  • Forms & Validation: Master Symfony's powerful Form component and validation constraints.
  • Security: Implement authentication and authorization using Symfony's Security component.
  • Console Commands: Build custom CLI tools for your application.
  • API Platform: Explore how Symfony powers modern APIs with minimal code.

Best Resources:

Framework Agnostic Skills

Both frameworks teach you the same core concepts: MVC, routing, ORM, dependency injection, templating, and testing. Master one, and you'll understand the other in a weekend.

Essential Skills Beyond the Framework

Regardless of which framework you choose, these skills are fundamental to professional PHP development. You don't need to master them all at once—pick one, get comfortable, then move to the next.

1. Security Best Practices

Why It Matters: While you've learned basics like prepared statements and htmlspecialchars(), professional applications require a comprehensive security mindset. Security vulnerabilities can destroy user trust, leak data, and end careers.

Critical Topics:

  • CSRF (Cross-Site Request Forgery) Protection: Prevent attackers from making unauthorized requests on behalf of your users using tokens.
  • XSS (Cross-Site Scripting) Prevention: Beyond basic escaping—understand context-aware output encoding and Content Security Policy (CSP) headers.
  • Password Security: Use password_hash() and password_verify() with bcrypt/argon2. Never roll your own crypto.
  • Input Validation vs. Sanitization: Validate early (reject bad data), sanitize before storage and output.
  • Security Headers: Implement X-Frame-Options, X-Content-Type-Options, Strict-Transport-Security, and CSP.
  • Rate Limiting: Prevent brute force attacks and API abuse.
  • OWASP Top 10: Familiarize yourself with the most critical web application security risks.

First Steps (~1–2 weeks):

  1. Read the OWASP Top 10: Understand the most common vulnerabilities (SQL Injection, XSS, CSRF, etc.).
  2. Implement CSRF protection: Add token-based CSRF protection to one of your forms.
  3. Review your authentication: Ensure you're using password_hash() with the PASSWORD_DEFAULT algorithm (never MD5 or SHA1).
  4. Add security headers: Configure your web server or middleware to send proper security headers.
  5. Test your application: Try to attack your own app—attempt SQL injection, XSS, and CSRF. Find your vulnerabilities before others do.

Resources:

Security Is Not Optional

A single security vulnerability can compromise your entire application. Make security a habit from day one, not an afterthought. When in doubt, use battle-tested framework features instead of building your own.

2. Code Quality and Static Analysis

Why It Matters: While PSR-12 ensures your code looks consistent, static analysis tools ensure it's logically correct. These tools catch bugs, type errors, and potential issues before you even run your code.

Key Tools:

  • PHPStan: Finds bugs in your code without running it. Catches type errors, undefined variables, impossible conditions, and more.
  • Psalm: Similar to PHPStan but with additional focus on type safety and security.
  • PHP CS Fixer: Automatically fixes code style issues (you learned this in Chapter 16).
  • PHP_CodeSniffer: Alternative to PHP CS Fixer for detecting and fixing style violations.

First Steps (~3–5 days):

  1. Install PHPStan: Add it to your project with composer require --dev phpstan/phpstan.
  2. Run your first analysis: Execute ./vendor/bin/phpstan analyse src --level 0 and gradually increase the level (0-9).
  3. Fix issues: Start with level 0 and work your way up. Each level catches more sophisticated problems.
  4. Add to CI/CD: Make static analysis part of your automated testing pipeline.
  5. Explore extensions: Try PHPStan's strict rules, deprecation rules, or framework-specific extensions.

Example PHPStan Configuration (phpstan.neon):

yaml
parameters:
  level: 6
  paths:
    - src
    - tests
  excludePaths:
    - vendor

Resources:

Start Strict Early

It's much easier to maintain high standards from the beginning than to retrofit them later. Add PHPStan to new projects from day one at level 6 or higher.

3. Automated Testing

Why It Matters: We've been testing our applications by clicking around in the browser. This is slow, tedious, and doesn't scale. Professional developers write automated tests that run in seconds and catch bugs before they reach production.

Types of Tests:

  • Unit Tests: Test a single class or method in isolation. Fast and focused.
  • Integration Tests: Test how multiple components work together (e.g., controller + database).
  • End-to-End (E2E) Tests: Simulate a real user clicking through your application in a browser.

First Steps (~1 week):

  1. Install PHPUnit (the industry standard) in your framework project.
  2. Write your first unit test: Test a simple utility function or model method.
  3. Write a feature test: Test that a route returns a successful response and the correct data.
  4. Run tests automatically: Add a pre-commit hook or GitHub Action to run tests on every push.

Tools to Learn:

  • PHPUnit: The foundation for PHP testing.
  • Pest (optional): A modern, elegant alternative built on PHPUnit—especially popular in Laravel.
  • Dusk (Laravel) or Panther (Symfony): For browser-based E2E tests.

Start Small

Don't aim for 100% test coverage on your first project. Start by testing critical business logic and work your way out. Even 20% well-tested code is infinitely better than zero.

4. Building and Consuming APIs

Why It Matters: Modern applications rarely exist in isolation. They integrate with payment processors, email services, third-party data providers, and mobile or JavaScript frontends. APIs are the language of these integrations.

Key Concepts:

  • REST APIs: The standard for web APIs. Learn HTTP methods (GET, POST, PUT, DELETE), status codes (200, 404, 500), and JSON responses.
  • API Authentication: Understand tokens (JWT), OAuth, and API keys.
  • GraphQL (optional): A newer, more flexible query language for APIs. Gaining popularity but not yet as widespread as REST.

First Steps (~1–2 weeks):

  1. Consume a public API: Use PHP's file_get_contents() or the Guzzle HTTP client to fetch data from a free API like JSONPlaceholder or OpenWeatherMap.
  2. Build a simple REST API: Create a JSON API for your blog or task manager. Return lists of items, single items, and handle POST/PUT/DELETE requests.
  3. Test your API: Use tools like Postman or Insomnia to manually test endpoints.
  4. Add authentication: Protect your API endpoints with token-based auth (Laravel Sanctum or Symfony's API Token system).

Resources:

5. Frontend Development Fundamentals

Why It Matters: You're a back-end developer, but you don't work in a vacuum. Understanding how the frontend consumes your APIs and renders your data makes you a better, more collaborative developer—and expands your career options.

What to Learn:

  • Modern JavaScript (ES6+): Arrow functions, promises, async/await, modules, destructuring.
  • Fetch API: How JavaScript makes HTTP requests to your back-end.
  • A Frontend Framework: Pick one based on your framework:
    • Vue.js: The most popular choice for Laravel developers. Laravel Inertia makes them work seamlessly together.
    • React: The most popular overall, massive ecosystem, great for complex UIs.
    • Svelte: Newer, simpler, and gaining momentum.

First Steps (~2–3 weeks):

  1. Brush up on vanilla JavaScript: Complete the JavaScript30 challenge (free, 30 small projects).
  2. Build a simple SPA (Single Page Application): Fetch data from your API and render it dynamically without page reloads.
  3. Try a framework tutorial: Work through the official getting started guide for Vue, React, or Svelte.
  4. Connect to your API: Replace the hardcoded data with real data from your back-end.

Resources:

6. Performance Optimization and Caching

Why It Matters: A slow application is a bad application. Users expect pages to load in under 2 seconds. Performance affects user experience, SEO rankings, server costs, and ultimately, your bottom line.

Key Topics:

  • OPcache: PHP's built-in bytecode cache. Enable it in production—it's free performance.
  • Application Caching: Store expensive operations (database queries, API calls) in cache systems like Redis or Memcached.
  • Query Optimization: Use database indexes, avoid N+1 queries, and optimize slow queries.
  • Profiling: Use tools like Xdebug and Blackfire to identify bottlenecks.
  • HTTP Caching: Leverage browser caching, CDNs, and reverse proxies (Varnish, Nginx).
  • Lazy Loading: Load resources only when needed.

First Steps (~1 week):

  1. Enable OPcache: Check if it's enabled (php -i | grep opcache) and configure it in php.ini.
  2. Profile your application: Install Xdebug and generate a cachegrind file. Analyze it with tools like KCacheGrind or Webgrind.
  3. Add Redis caching: Install Redis and cache expensive database queries or API responses for 5-60 minutes.
  4. Optimize database queries: Use EXPLAIN to analyze slow queries and add appropriate indexes.
  5. Measure improvements: Use tools like Apache Bench or Siege to benchmark before and after.

Example: Simple Cache Wrapper:

php
class Cache
{
    private Redis $redis;

    public function remember(string $key, int $ttl, callable $callback): mixed
    {
        $cached = $this->redis->get($key);
        if ($cached !== false) {
            return unserialize($cached);
        }

        $value = $callback();
        $this->redis->setex($key, $ttl, serialize($value));
        return $value;
    }
}

// Usage
$posts = $cache->remember('posts:all', 3600, function() use ($db) {
    return $db->query('SELECT * FROM posts')->fetchAll();
});

Resources:

Low-Hanging Fruit

Before optimizing code, enable OPcache and add database indexes. These two changes alone can improve performance by 2-10x with minimal effort.

7. Logging and Debugging

Why It Matters: In production, you can't use var_dump() or dd() to debug. Professional applications use structured logging to track errors, monitor performance, and understand user behavior.

Key Concepts:

  • Structured Logging: Use proper log levels (DEBUG, INFO, WARNING, ERROR, CRITICAL) and context.
  • PSR-3 Logger Interface: The standard logging interface in PHP.
  • Monolog: The de facto logging library for PHP.
  • Log Aggregation: Centralize logs from multiple servers (Papertrail, Loggly, ELK stack).
  • Error Tracking: Use services like Sentry or Bugsnag to capture and alert on production errors.

First Steps (~3–5 days):

  1. Install Monolog: composer require monolog/monolog.
  2. Set up basic logging: Log to files with rotation (daily, max size).
  3. Add context: Include user IDs, request IDs, and relevant data with every log entry.
  4. Integrate error tracking: Sign up for Sentry (free tier) and configure it to catch exceptions.
  5. Monitor logs: Set up alerts for critical errors.

Example: Monolog Setup:

php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\RotatingFileHandler;

$log = new Logger('app');
$log->pushHandler(new RotatingFileHandler(__DIR__ . '/logs/app.log', 30, Logger::INFO));

$log->info('User logged in', ['user_id' => 42, 'ip' => '127.0.0.1']);
$log->error('Payment failed', ['order_id' => 123, 'amount' => 99.99]);

Resources:

8. Design Patterns and Architecture

Why It Matters: You've learned basic OOP, but professional applications use established design patterns to solve common problems. These patterns make your code more maintainable, testable, and easier to understand.

Essential Patterns:

  • Dependency Injection: Pass dependencies into classes instead of creating them internally. Makes testing easier.
  • Repository Pattern: Abstract database access behind an interface. Swap implementations without changing business logic.
  • Factory Pattern: Create objects without specifying their exact class.
  • Strategy Pattern: Encapsulate algorithms and make them interchangeable.
  • Observer Pattern: One object notifies many others when state changes (events/listeners).
  • Singleton Pattern: Ensure only one instance exists (use sparingly—often an anti-pattern).

First Steps (~1–2 weeks):

  1. Learn the Gang of Four patterns: Read Design Patterns: Elements of Reusable Object-Oriented Software or watch video summaries.
  2. Refactor existing code: Identify repeated code and apply appropriate patterns.
  3. Use dependency injection: Stop using new inside classes; inject dependencies via constructors.
  4. Implement Repository pattern: Create a PostRepository interface and implementation for your blog.

Example: Repository Pattern:

php
interface PostRepositoryInterface
{
    public function findAll(): array;
    public function findById(int $id): ?Post;
    public function save(Post $post): void;
    public function delete(int $id): void;
}

class PDOPostRepository implements PostRepositoryInterface
{
    public function __construct(private PDO $pdo) {}

    public function findAll(): array
    {
        $stmt = $this->pdo->query('SELECT * FROM posts');
        return $stmt->fetchAll(PDO::FETCH_CLASS, Post::class);
    }

    // ... other methods
}

// Now you can swap implementations (in-memory for tests, Redis for caching, etc.)
class PostController
{
    public function __construct(private PostRepositoryInterface $posts) {}
}

Resources:

9. DevOps and Deployment

Why It Matters: Your application isn't "done" until real users can access it. Understanding deployment, servers, and automation transforms you from someone who writes code to someone who ships products.

Core Skills:

  • Linux Command Line: Navigate directories, manage files, edit with vim or nano, check logs.
  • Docker: Package your application and its dependencies into a container that runs identically everywhere.
  • CI/CD (Continuous Integration / Continuous Deployment): Automatically test, build, and deploy your code on every commit.

First Steps (~2–3 weeks):

  1. Get comfortable with Linux: Spin up a free VPS (e.g., DigitalOcean, Linode, Vultr) and practice basic commands.
  2. Deploy your app manually: Use SSH to connect, install dependencies, configure a web server (Nginx or Apache), and get your app running.
  3. Learn Docker basics: Install Docker, run an official PHP container, and create a simple Dockerfile for your project.
  4. Set up GitHub Actions: Create a workflow that runs your tests on every push. Then extend it to deploy automatically on success.

Resources:

Community, Resources, and Getting Help

The PHP community is one of the most welcoming and active in the programming world. You're never alone when you're stuck.

Learning Resources

  • PHP.net: The official PHP documentation. Learn to read it—it's your most reliable reference.
  • PHP The Right Way: A community-curated guide to modern PHP best practices. Updated regularly.
  • Laracasts: The gold standard for Laravel and PHP video tutorials (free and premium).
  • SymfonyCasts: The definitive resource for mastering Symfony (free and premium).
  • The PHP-FIG: Follow the PHP Framework Interop Group to stay current with PSR standards.

Getting Help When You're Stuck

Staying Current

  • PHP Weekly: A curated newsletter with the best PHP articles, tutorials, and news each week.
  • Laravel News: Stay up-to-date with the Laravel ecosystem.
  • PHP Annotated Monthly: JetBrains' monthly roundup of PHP news and articles.

The Best Way to Learn

You can watch 100 hours of tutorials and read 1,000 articles, but nothing compares to building. Start a project, get stuck, Google the error, fix it, and repeat. That's how you truly learn.

Your First 30 Days: A Concrete Action Plan

Feeling overwhelmed by all the options? Here's a focused, realistic 30-day plan to build momentum. Pick one path based on your immediate goals.

Path A: Framework Deep Dive (For Building Web Applications)

Week 1–2: Choose Laravel or Symfony. Complete the official getting started tutorial (Laravel Bootcamp or Symfony Fast Track).

Week 3: Build a small project from scratch—something useful to you (task manager, expense tracker, recipe organizer). Focus on CRUD operations, forms, and validation.

Week 4: Add authentication and deploy your project to a real server. Share it with one person and get feedback.

Daily Commitment: ~1–2 hours of focused practice.

Path B: API-First Approach (For Building Backend Services)

Week 1–2: Build a REST API for a simple domain (e.g., a book library or a todo list). Use Laravel or Symfony. Return JSON, handle GET/POST/PUT/DELETE.

Week 3: Add authentication (JWT or token-based), write your first API tests using PHPUnit, and document your endpoints.

Week 4: Consume your API from a simple JavaScript frontend or mobile app. Deploy both the API and the frontend.

Daily Commitment: ~1–2 hours of focused practice.

Path C: Strengthen Foundations (Before Framework Mastery)

Week 1: Deep dive into PHP's OOP features—practice traits, interfaces, abstract classes, dependency injection manually.

Week 2: Master Composer and PSR standards. Refactor a previous project to follow PSR-12 coding standards.

Week 3: Write unit tests for your code using PHPUnit. Aim for 50% test coverage on one small project.

Week 4: Learn Git deeply—branching, merging, rebasing, pull requests. Contribute to an open-source project (even just fixing a typo in documentation).

Daily Commitment: ~1 hour of focused practice.

Don't Try to Learn Everything at Once

The biggest mistake beginners make is trying to learn ten things simultaneously. Pick one path, commit for 30 days, and finish something. Then move to the next skill. Depth beats breadth every time.

Exercises: Your Next Steps

Choose one exercise from each section below and complete it within the next 30 days.

Framework Practice

  1. Laravel: Build a simple blog with user authentication. Users can create, edit, and delete their own posts. Deploy it using Laravel Forge or a free platform like Railway.
  2. Symfony: Create a product catalog with categories. Implement full CRUD operations and search functionality. Deploy using a VPS or Platform.sh.

API Development

  1. Build a RESTful API for a todo application with endpoints for listing, creating, updating, and deleting tasks. Add token-based authentication.
  2. Consume a third-party API: Build a weather app that fetches data from the OpenWeatherMap API and displays it in a clean interface.

Testing

  1. Write unit tests for the blog system you built in Chapter 19. Test the Post model methods and controller logic.
  2. Write a feature test that simulates a user registering, logging in, creating a post, and logging out. Make it pass.

Deployment & DevOps

  1. Deploy your application to a VPS (DigitalOcean, Linode, or Vultr). Configure Nginx, set up SSL with Let's Encrypt, and get it running.
  2. Create a Docker setup for your PHP application with separate containers for PHP, Nginx, and MySQL. Use docker-compose to orchestrate them.

Open Source Contribution

  1. Find a beginner-friendly issue on GitHub in a PHP project (search for labels like "good first issue" or "beginner"). Submit a pull request—even fixing a typo counts.
  2. Document your learning: Start a blog or dev.to account and write a tutorial on something you struggled with and overcame. Teaching solidifies knowledge.

Track Your Progress

Create a simple checklist or GitHub project board with these exercises. Check them off as you complete them. Visible progress is incredibly motivating.

Exploring Advanced PHP 8.4 Features

As you build real projects, you'll want to leverage the latest PHP 8.4 capabilities. Here are some features to explore as you grow:

Property Hooks

PHP 8.4 introduces property hooks—a cleaner alternative to traditional getters and setters. They allow you to add behavior when reading or writing properties without verbose method definitions.

php
class User
{
    public string $email {
        set => strtolower($value); // Auto-lowercase emails
    }

    public string $name {
        get => ucfirst($this->name); // Always capitalize
    }
}

Asymmetric Visibility

Control read and write access to properties independently—useful for immutability and encapsulation.

php
class Product
{
    public private(set) string $id; // Public read, private write

    public function __construct(string $id)
    {
        $this->id = $id; // Can only set internally
    }
}

New Array Functions

PHP 8.4 adds several useful array functions that make common operations more expressive:

  • array_find(): Find the first element matching a condition
  • array_find_key(): Find the key of the first matching element
  • array_any(): Check if any element matches a condition
  • array_all(): Check if all elements match a condition

When to Explore These

Don't feel pressured to use every new feature immediately. Learn them as you encounter problems they solve. Framework code will gradually adopt these patterns, and you'll pick them up naturally through reading and contributing to modern codebases.

Resources:

Final Words

You've just completed something that most people who say "I should learn to code" never do—you actually did it. From your first <?php echo "Hello, World!"; ?> to building database-driven applications with proper architecture, you've traveled an incredible distance.

But here's the truth: You're not at the finish line. You're at the starting line of something much bigger. The journey from beginner to expert isn't about one big leap—it's about showing up consistently, building things that scare you a little, and learning from every mistake.

What Separates Good Developers from Great Ones

It's not raw talent or memorizing syntax. It's:

  • Building in public: Share your projects, write about your learnings, and help others who are a few steps behind you.
  • Reading code: Spend as much time reading other people's code as writing your own. Open-source projects are a goldmine.
  • Embracing failure: Every bug is a lesson. Every broken deployment is a story. Every "I have no idea how to do this" moment is an opportunity.

Your Challenge

Within the next 48 hours, take one concrete action:

  • Start a new Laravel or Symfony project.
  • Deploy something (anything!) to a live server.
  • Write one unit test for code you've already written.
  • Join a PHP Discord/Slack and introduce yourself.
  • Open the documentation for a feature you've never used and build something with it.

Don't wait until you feel "ready." You're ready now.

Knowledge Check

Reflect on your learning journey:

Chapter 22 Quiz: Your Next Steps

Question 1 of 5
What is the best way to continue learning after completing this series?
  • Build real projects and learn frameworks deeply
  • Only read documentation without building
  • Wait until you know everything before starting
  • Memorize all PHP functions

A Final Thank You

Thank you for trusting this series to guide you. The PHP community is better with you in it. Now go build something amazing—and when you do, come back and share it. We'd love to see what you create.

Keep building. Keep learning. Stay curious. And remember: every expert developer you admire was once exactly where you are now.

Happy coding!


Further Reading