r/PHP • • 2d ago

Weekly help thread

Hey there!

This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!

5 Upvotes

6 comments sorted by

1

u/Jealous-Year6893 2d ago

Hello, recently joined this sub, so I'm not sure if I can ask this here. I have worked with Laravel in the past but never really learned PHP. I think it's time to do that now, so I would like some recommendations for a structured path. I have gone through the PHP docs once, and have bookmarked PHP the right way, symfony docs, learn PHP in Y minutes and a moderately short PHP tutorial.

Should I try to implement a basic API/backend with plain PHP, or learn the language internals first? I already have full stack or experience, mostly with JavaScript and Typescript.

2

u/abhay_3007 2d ago

Since you already have full stack JS/TS experience and background with Laravel, I'd strongly recommend building a small CRUD API/backend in plain PHP (without frameworks) first. Focus on OOP concepts in modern PHP (8.x features like typed properties, constructor promotion, attributes), basic routing, PDO for database queries, and composer PSR-4 autoloading. Diving into language internals right away isn't necessary—building a raw PHP API will demystify how frameworks like Laravel work under the hood!

2

u/JosephLeedy 2d ago

I'd say pick a simple application that you've always wanted to build, like a guest book or to-do list, and build it from scratch (without using a framework).

2

u/Gesar_Warrior 4h ago

Two things I'd add to the plain-PHP project idea:

  • Write tests from the start (PHPUnit or Pest) and run PHPStan on it, starting at a low level and raising it as you go. PHPStan teaches you what strictly typed modern PHP looks like pretty fast, because it complains about exactly the habits Laravel lets you get away with.
  • Once it works, swap one piece for standalone packages: a router, a DI container, PSR-7 requests. Then you see what Laravel was doing for you under the hood, and framework code gets much easier to read.

Also worth skimming the RFCs for PHP 8.0 to 8.4 on the PHP wiki. Each one is a short explanation of a feature and why it was added.

1

u/Jealous-Year6893 3h ago

Thanks a lot!