From Laravel to Symfony | Day 2
Continuing my series on learning Symfony to transition from Laravel, today I’m diving into Dependency Injection (DI), the service container, and want to talk the contrast between simple and complex solutions in both frameworks. If you missed the previous parts, you can find them here:
[From Laravel to Symfony | Day 0](https://www.reddit.com/r/symfony/comments/1ins69p/from_laravel_to_symfony_day_0/)
[From Laravel to Symfony | Day 1](https://www.reddit.com/r/symfony/comments/1izrt2g/from_laravel_to_symfony_day_1/)
# 1. Dependency Injection & the Service Container
I have to admit—Symfony’s DI is incredibly powerful. It offers a level of flexibility that I’m not sure I’ll ever fully utilize. However, it’s always better to have more capacity than to hit limitations down the road. One feature I particularly like is "tags", which allow you to “hook” into different parts of Symfony’s internals in a structured way. Laravel also has tags, but they serve a different purpose—mainly for grouping items together for later resolution from the Container.
While reading Symfony’s documentation on DI, I finally understood why Laravel’s **Service Providers** are named that way. The concept of “services” in Symfony aligns with `services.yaml`, where almost everything is defined as a service. However, in Laravel, Service Providers—despite their `register` and `boot` methods—seem to have evolved into a mechanism more focused on configuration and initialization rather than DI configuration itself.
That being said, Laravel does provide ways to handle flexible dependencies as well, just in a different way:
services:
ServiceA:
arguments:
$myVariable: 'value of the variable'
--- vs ---
$this->app
->when(ServiceA::class)
->needs('$myVariable')
->give("value of the variable");
Another interesting difference: Laravel’s container creates a new instance each time by default, unless explicitly registered as `singleton` or `instance`. Symfony, on the other hand, follows the singleton pattern by default, meaning it creates an instance once and reuses it.
Also, Laravel doesn’t rely on DI as heavily as Symfony does. Many dependencies (especially framework-level ones) are accessible via Facades. And just a quick note—Facades in Laravel are NOT some proprietary invention; they’re simply a design pattern that Laravel adopted as a way to access container-bound services. You’re not forced to use them—you can always rely on constructor injection if you prefer.
# 2. Simple vs. Complex Solutions
One key difference I’m noticing is the contrast between simplicity and flexibility (with complexity) when solving common problems in both frameworks. For example, this “Laravel code” (to get list of all the users): `User::all()` where, under the hood, many distinct things are happening:
* Connection Management
* Query Builder
* Data Mapping (Hydration)
* Data Value (attributes and “casting”)
* and, Pagination logic (if used as `User::pagiante()`).
From one side, it might not seem like the “right” approach (because it's not SOLID**!**), on the other side, do you need the flexibility (and complexity, or at least “extra code”) Symfony goes with just to get the list of users? Symfony, requires more setup—going through a repository, entity manager, and a custom pagination solution (or an extra package). So, the way I see it - Symfony enforces a structured, explicit approach, while Laravel prioritizes convenience (1 line vs many classes).
Another example would be Laravel Queue vs. Symfony Messenger. Laravel’s queue system is practically plug-and-play. Define a job, dispatch it, run a worker. Done. Of course, extra configuration is available. Symfony’s Messenger, on the other hand, is more low-level. It’s incredibly flexible—you can configure multiple buses, custom transports, envelopes, middleware, and stamps, etc.
>So, is it flexible and powerful enough? - Definitely.
>Do you need this flexibility (and complexity)? - It depends.
So far, I’m leaning
Continuing my series on learning Symfony to transition from Laravel, today I’m diving into Dependency Injection (DI), the service container, and want to talk the contrast between simple and complex solutions in both frameworks. If you missed the previous parts, you can find them here:
[From Laravel to Symfony | Day 0](https://www.reddit.com/r/symfony/comments/1ins69p/from_laravel_to_symfony_day_0/)
[From Laravel to Symfony | Day 1](https://www.reddit.com/r/symfony/comments/1izrt2g/from_laravel_to_symfony_day_1/)
# 1. Dependency Injection & the Service Container
I have to admit—Symfony’s DI is incredibly powerful. It offers a level of flexibility that I’m not sure I’ll ever fully utilize. However, it’s always better to have more capacity than to hit limitations down the road. One feature I particularly like is "tags", which allow you to “hook” into different parts of Symfony’s internals in a structured way. Laravel also has tags, but they serve a different purpose—mainly for grouping items together for later resolution from the Container.
While reading Symfony’s documentation on DI, I finally understood why Laravel’s **Service Providers** are named that way. The concept of “services” in Symfony aligns with `services.yaml`, where almost everything is defined as a service. However, in Laravel, Service Providers—despite their `register` and `boot` methods—seem to have evolved into a mechanism more focused on configuration and initialization rather than DI configuration itself.
That being said, Laravel does provide ways to handle flexible dependencies as well, just in a different way:
services:
ServiceA:
arguments:
$myVariable: 'value of the variable'
--- vs ---
$this->app
->when(ServiceA::class)
->needs('$myVariable')
->give("value of the variable");
Another interesting difference: Laravel’s container creates a new instance each time by default, unless explicitly registered as `singleton` or `instance`. Symfony, on the other hand, follows the singleton pattern by default, meaning it creates an instance once and reuses it.
Also, Laravel doesn’t rely on DI as heavily as Symfony does. Many dependencies (especially framework-level ones) are accessible via Facades. And just a quick note—Facades in Laravel are NOT some proprietary invention; they’re simply a design pattern that Laravel adopted as a way to access container-bound services. You’re not forced to use them—you can always rely on constructor injection if you prefer.
# 2. Simple vs. Complex Solutions
One key difference I’m noticing is the contrast between simplicity and flexibility (with complexity) when solving common problems in both frameworks. For example, this “Laravel code” (to get list of all the users): `User::all()` where, under the hood, many distinct things are happening:
* Connection Management
* Query Builder
* Data Mapping (Hydration)
* Data Value (attributes and “casting”)
* and, Pagination logic (if used as `User::pagiante()`).
From one side, it might not seem like the “right” approach (because it's not SOLID**!**), on the other side, do you need the flexibility (and complexity, or at least “extra code”) Symfony goes with just to get the list of users? Symfony, requires more setup—going through a repository, entity manager, and a custom pagination solution (or an extra package). So, the way I see it - Symfony enforces a structured, explicit approach, while Laravel prioritizes convenience (1 line vs many classes).
Another example would be Laravel Queue vs. Symfony Messenger. Laravel’s queue system is practically plug-and-play. Define a job, dispatch it, run a worker. Done. Of course, extra configuration is available. Symfony’s Messenger, on the other hand, is more low-level. It’s incredibly flexible—you can configure multiple buses, custom transports, envelopes, middleware, and stamps, etc.
>So, is it flexible and powerful enough? - Definitely.
>Do you need this flexibility (and complexity)? - It depends.
So far, I’m leaning
Reddit
From the symfony community on Reddit: From Laravel to Symfony | Day 0
Posted by Prestigious-Type-973 - 1 vote and 0 comments
toward this statement:
* Laravel is an excellent choice for small to medium projects that need quick setup, an MVP, or a PoC. It provides a strong out-of-the-box experience with sane defaults.
* Symfony is ideal for long-term projects where you can invest time (and budget?) upfront to fine-tune it to your needs.
\---
Also, I would like to ask the community (you) to define “magic” (referred as "Laravel magic"). What exactly do you put in this meaning and definition so that when I work with those frameworks, I could clearly distinguish and identify “magic moments”. Because, it feels like there are some things that I could call “magical” in Symfony too.
Thanks.
https://redd.it/1jaf2lt
@r_php
* Laravel is an excellent choice for small to medium projects that need quick setup, an MVP, or a PoC. It provides a strong out-of-the-box experience with sane defaults.
* Symfony is ideal for long-term projects where you can invest time (and budget?) upfront to fine-tune it to your needs.
\---
Also, I would like to ask the community (you) to define “magic” (referred as "Laravel magic"). What exactly do you put in this meaning and definition so that when I work with those frameworks, I could clearly distinguish and identify “magic moments”. Because, it feels like there are some things that I could call “magical” in Symfony too.
Thanks.
https://redd.it/1jaf2lt
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
🎬 Catch up on the Laravel Cloud AMA with Cloud team lead Joe Dixon (Summary)
https://youtu.be/d8zuM6jtqOs
https://redd.it/1jacxco
@r_php
https://youtu.be/d8zuM6jtqOs
https://redd.it/1jacxco
@r_php
YouTube
63 Laravel Cloud Questions with Joe Dixon (Summary)
Join Joe Dixon, Engineering Team Lead of Laravel Cloud, in an in-depth Q&A session covering 63 questions about Laravel Cloud. Joe dives into the development process, infrastructure decisions, and technical implementation details that power Laravel Cloud.…
I created an open-source app to browse laravel's new community starer kits!
Hello everyone! So I discovered a few hours ago that laravel now allows for custom community starterkits!
Thanks to the team for that btw! I am not sure if they are planning on making an app to browse these or not in the near future, so I figured, why not do it myself lol
You can find the link here:
Laravel Starterkits Gallery
(I will probably buy an actual domain if there is actually demand)
This is VERY early in development btw, there are a lot of features I want to add (again, if there is enough demand).
Roadmap
You can find the github link here: https://github.com/AndryTafa/laravel-community-starterkits
Disclaimer: This is very much into early development, so if there is any bugs, or maybe crashes, please bear with me lol
If you have any feedback, please feel free to DM me, and feel free to contribute! (However, I will firstly add a roadmap to the readme, so if you would like to contribute, you could have a look at the things I will want to work on)
I would appreciate a star :P
Any feedback is appreciated. thanks!
https://redd.it/1jaedi2
@r_php
Hello everyone! So I discovered a few hours ago that laravel now allows for custom community starterkits!
Thanks to the team for that btw! I am not sure if they are planning on making an app to browse these or not in the near future, so I figured, why not do it myself lol
You can find the link here:
Laravel Starterkits Gallery
(I will probably buy an actual domain if there is actually demand)
This is VERY early in development btw, there are a lot of features I want to add (again, if there is enough demand).
Roadmap
You can find the github link here: https://github.com/AndryTafa/laravel-community-starterkits
Disclaimer: This is very much into early development, so if there is any bugs, or maybe crashes, please bear with me lol
If you have any feedback, please feel free to DM me, and feel free to contribute! (However, I will firstly add a roadmap to the readme, so if you would like to contribute, you could have a look at the things I will want to work on)
I would appreciate a star :P
Any feedback is appreciated. thanks!
https://redd.it/1jaedi2
@r_php
Is there a tool for visualization?
Does anyone know if there's a website for visualization for PHP that shows the process what's happening when your run a block of code?
https://redd.it/1jaarqd
@r_php
Does anyone know if there's a website for visualization for PHP that shows the process what's happening when your run a block of code?
https://redd.it/1jaarqd
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Statamic CMS as rest-api endpoint for big data
Hi guys, I'd need to create a ecommerce rest-api and looking for a ready to use cms..
Anyone ever used statmic as a rest-api based cms? Any feedbacks?
I know there are some lacks of functionalities, like in-built auth or different collections for different tables, can it be a good idea as a rest-api (with around million records) ?
https://redd.it/1jaaf6h
@r_php
Hi guys, I'd need to create a ecommerce rest-api and looking for a ready to use cms..
Anyone ever used statmic as a rest-api based cms? Any feedbacks?
I know there are some lacks of functionalities, like in-built auth or different collections for different tables, can it be a good idea as a rest-api (with around million records) ?
https://redd.it/1jaaf6h
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
NASAStan - a PHPStan extension for enforcing NASA's Power of Ten rules in PHP.
https://github.com/JoeyMckenzie/nasastan
https://redd.it/1jaljgo
@r_php
https://github.com/JoeyMckenzie/nasastan
https://redd.it/1jaljgo
@r_php
GitHub
GitHub - JoeyMckenzie/nasastan: PHPStan extension for enforcing NASA's Power of Ten in your PHP code.
PHPStan extension for enforcing NASA's Power of Ten in your PHP code. - JoeyMckenzie/nasastan
Symfony vs Laravel - A humble request (Part 3)
https://clegginabox.co.uk/symfony-vs-laravel-a-humble-request-part-3/
https://redd.it/1jamr4z
@r_php
https://clegginabox.co.uk/symfony-vs-laravel-a-humble-request-part-3/
https://redd.it/1jamr4z
@r_php
Clegginabox
Symfony vs Laravel - A humble request (Part 3)
In this post I'll actually make some progress towards persisting our humble request. Before that I'm going to talk about a snake, to be more precise - Python.
Very early in my career I was really fortunate to work alongside a really experienced and patient…
Very early in my career I was really fortunate to work alongside a really experienced and patient…
Ideal ai/symfony/ide setup for "old newbie"?
Hey guys I haven't done any web development for a long time but was a fairly decent self-taught web dev a few years ago.
I use claude a lot for my work and am wondering if I can use claude and microsoft code studio to help me build out some new symfony projects and maybe dust off and upgrade some old ones.
So my question is what utilities/tools do you use to connect claude (or the ai of your choice) to Symfony and your favorite code editor and also what is your ai of choice?
https://redd.it/1jaqaxh
@r_php
Hey guys I haven't done any web development for a long time but was a fairly decent self-taught web dev a few years ago.
I use claude a lot for my work and am wondering if I can use claude and microsoft code studio to help me build out some new symfony projects and maybe dust off and upgrade some old ones.
So my question is what utilities/tools do you use to connect claude (or the ai of your choice) to Symfony and your favorite code editor and also what is your ai of choice?
https://redd.it/1jaqaxh
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
I can now easily search all 420 GB of PHP source code in Packagist.org. What do you want to search for?
Limitations:
I can search by first letter of the vendor, the entire thing.
The cut-off date is the last time my Bettergist Collector did the full analysis of all reachable composer packages, which is done quarterly. Currently: 2024-12-31.
It's running on the dedicated server locally, and takes about 5 minutes per query.
The results will be dumped into a search log, such as this one: https://www.bettergist.dev/searches/povils.phpmnd-search.log
If you give me plaintext to exclude, I can do that, too. (in the above search, everything in a directory called `phpmnd` was excluded).
The max size of a search result is currently hard-coded to 5 MB.
Only file names will be shown if you want.
I got really really excited when I dev'd this today and I wanted to share with you. Search 420 GB of pure PHP code in less than 5 minutes. How cool is that?!
The tech does have the ability to do regex searches. You'd need to make sure it's compatible with grep on the CLI. Regex seems to take 30 minutes.
https://redd.it/1japt28
@r_php
Limitations:
I can search by first letter of the vendor, the entire thing.
The cut-off date is the last time my Bettergist Collector did the full analysis of all reachable composer packages, which is done quarterly. Currently: 2024-12-31.
It's running on the dedicated server locally, and takes about 5 minutes per query.
The results will be dumped into a search log, such as this one: https://www.bettergist.dev/searches/povils.phpmnd-search.log
If you give me plaintext to exclude, I can do that, too. (in the above search, everything in a directory called `phpmnd` was excluded).
The max size of a search result is currently hard-coded to 5 MB.
Only file names will be shown if you want.
I got really really excited when I dev'd this today and I wanted to share with you. Search 420 GB of pure PHP code in less than 5 minutes. How cool is that?!
The tech does have the ability to do regex searches. You'd need to make sure it's compatible with grep on the CLI. Regex seems to take 30 minutes.
https://redd.it/1japt28
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
PHPoker: The PHP Extension
Not trying to spam everyone! But...
There were a few (very valid) comments on my original PHPoker post(s) last week that discussed performance concerns.
PHP is not necessarily the most optimal choice when running a Monte Carlo simulation for millions of iterations. There are existing libraries for Rust/C++ which perform orders of magnitude better. What PHP does have, is the ability to integrate with C at a very low level - which led me to give this project a shot.
https://github.com/PHPoker/Extension
This is a PHP extension which implements the original implementation of Kevin "CactusKev" Suffecool's algorithm - as native PHP functions backed by C. It creates two new native PHP functions `poker_evaluate_hand()` and `poker_calculate_equity()`.
Being my first attempt at a PHP extension, I am sure there are a ton of things which can be done better. Ex. I am sure my equity calculation implementation is a little naive, and my C code probably looks amateurish.
With that being said, the performance improvements are already drastic! The standard PHP implementation was taking > 60s to run a few million simulations, this is already < 2s. I will do some proper benchmarking this weekend.
After the benchmarking, I want to improve the test suite, and do some exploration related to integrating the extension with the original library. Ex. have the PHPoker library use these native functions if available, and having the new native function use some of the enums/classes/types from the library, etc.
If you are a little adventurous and like poker, check out the ReadMe and run the build noscript. I would love any feedback, questions, comments, thanks for reading!
https://redd.it/1jawpjy
@r_php
Not trying to spam everyone! But...
There were a few (very valid) comments on my original PHPoker post(s) last week that discussed performance concerns.
PHP is not necessarily the most optimal choice when running a Monte Carlo simulation for millions of iterations. There are existing libraries for Rust/C++ which perform orders of magnitude better. What PHP does have, is the ability to integrate with C at a very low level - which led me to give this project a shot.
https://github.com/PHPoker/Extension
This is a PHP extension which implements the original implementation of Kevin "CactusKev" Suffecool's algorithm - as native PHP functions backed by C. It creates two new native PHP functions `poker_evaluate_hand()` and `poker_calculate_equity()`.
Being my first attempt at a PHP extension, I am sure there are a ton of things which can be done better. Ex. I am sure my equity calculation implementation is a little naive, and my C code probably looks amateurish.
With that being said, the performance improvements are already drastic! The standard PHP implementation was taking > 60s to run a few million simulations, this is already < 2s. I will do some proper benchmarking this weekend.
After the benchmarking, I want to improve the test suite, and do some exploration related to integrating the extension with the original library. Ex. have the PHPoker library use these native functions if available, and having the new native function use some of the enums/classes/types from the library, etc.
If you are a little adventurous and like poker, check out the ReadMe and run the build noscript. I would love any feedback, questions, comments, thanks for reading!
https://redd.it/1jawpjy
@r_php
GitHub
GitHub - PHPoker/Extension: A PHP extension for raw hand evaluation and equity calculation
A PHP extension for raw hand evaluation and equity calculation - GitHub - PHPoker/Extension: A PHP extension for raw hand evaluation and equity calculation
Livewire/blade Nvim setup
Currently work mainly with Laravel+inertia+react but want to have a play with livewire. Does anyone have any good plugin/config repo suggestions for neovim (specifically for blade w livewire components)
https://redd.it/1jaz5mx
@r_php
Currently work mainly with Laravel+inertia+react but want to have a play with livewire. Does anyone have any good plugin/config repo suggestions for neovim (specifically for blade w livewire components)
https://redd.it/1jaz5mx
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
JetBrains Xdebug Helper Browser Extension
https://blog.jetbrains.com/phpstorm/2025/03/jetbrains-xdebug-helper/
https://redd.it/1jb23qi
@r_php
https://blog.jetbrains.com/phpstorm/2025/03/jetbrains-xdebug-helper/
https://redd.it/1jb23qi
@r_php
🚀 Laravel 12 + React API Token Management – Watch This! 🔑
Hey Devs! If you're using Laravel 12 with the React Starterkit and need a simple way to handle API token management, you’ll want to check out this video! 🎥
I walk you through Keysmith React, a package I built to make API key generation, management, and permissions super easy with Laravel Sanctum and React components.
# 🔎 What You’ll Learn:
✅ Installing & setting up Keysmith React
✅ Choosing between Page or Settings templates
✅ Generating & managing API tokens with Laravel Sanctum
✅ Customizing permissions and authentication flow
✅ Running tests to ensure everything works smoothly
🎥 Watch the full tutorial here: https://youtu.be/cUyYTp\_eapI
Let me know what you think, and feel free to drop questions in the comments! 🙌
https://redd.it/1jb3pj8
@r_php
Hey Devs! If you're using Laravel 12 with the React Starterkit and need a simple way to handle API token management, you’ll want to check out this video! 🎥
I walk you through Keysmith React, a package I built to make API key generation, management, and permissions super easy with Laravel Sanctum and React components.
# 🔎 What You’ll Learn:
✅ Installing & setting up Keysmith React
✅ Choosing between Page or Settings templates
✅ Generating & managing API tokens with Laravel Sanctum
✅ Customizing permissions and authentication flow
✅ Running tests to ensure everything works smoothly
🎥 Watch the full tutorial here: https://youtu.be/cUyYTp\_eapI
Let me know what you think, and feel free to drop questions in the comments! 🙌
https://redd.it/1jb3pj8
@r_php
YouTube
🚀 Keysmith React – Laravel 12 API Token Management Made Easy! 🔑
Hey Devs! 👋
In this video, I walk you through Keysmith React, a Laravel 12 package that simplifies API token management using React and Laravel Sanctum. Whether you're building a SaaS app or a developer dashboard, Keysmith React provides pre-built, user…
In this video, I walk you through Keysmith React, a Laravel 12 package that simplifies API token management using React and Laravel Sanctum. Whether you're building a SaaS app or a developer dashboard, Keysmith React provides pre-built, user…
Proper way of non permitted action
Let say i hav use case in which only employees that have passed certain condition can be assigned some work.
So inside WorkController assignWork() method I do :
If(!$employee->pass()) {
//what should I do here?
//do i create exception?
//or use flash message to inform and reroute?
}else{
//create form and proceed as usual
}
Preferably i would like to show modal dialog to inform user. So what s best n proper way?
1. Exception or
2. Flash message?
3. Do checking in twig and hide button?
https://redd.it/1jb619p
@r_php
Let say i hav use case in which only employees that have passed certain condition can be assigned some work.
So inside WorkController assignWork() method I do :
If(!$employee->pass()) {
//what should I do here?
//do i create exception?
//or use flash message to inform and reroute?
}else{
//create form and proceed as usual
}
Preferably i would like to show modal dialog to inform user. So what s best n proper way?
1. Exception or
2. Flash message?
3. Do checking in twig and hide button?
https://redd.it/1jb619p
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Suggest a best template for building a SDK PHP/Laravel ?
hi,
i recently launched a web screenshot API, i am looking for a template to create a PHP/Laravel SDK for my API, i am good In JavaScript, Haven't used PHP in last few years, can anyone suggest a starter template for a SDK.
https://redd.it/1jbbdbd
@r_php
hi,
i recently launched a web screenshot API, i am looking for a template to create a PHP/Laravel SDK for my API, i am good In JavaScript, Haven't used PHP in last few years, can anyone suggest a starter template for a SDK.
https://redd.it/1jbbdbd
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
PHP RFC: Optional interfaces
https://wiki.php.net/rfc/optional-interfaces
https://redd.it/1jbcbtx
@r_php
https://wiki.php.net/rfc/optional-interfaces
https://redd.it/1jbcbtx
@r_php
I took the PHPill
For a while now my default way of building full stack web apps has been Flask + Sqlite + Whatever frontend I felt like. This usualy resulted in bloated, JS-full unmainanble mess. I have dabbled in using Go (Excellent) and Rust (Too type-happy) for my back-end but my front-end usually ended up being the thing that dragged me down. A minor epiphany of mine was discovering HTMX. But recently I got my mind blown by one of my friends who made a whole "smart map" (won't get into more detail) app whilst staying entirely Web 1.0 compliant. This prompted me to try PHP (though she was also using Flask but I didn't know it).
Honestly, the most fun I've had programming in years. In the span of an hour I had made a simple bulletin board app with nothing but html, PHP and SQL. It just blew my mind that you could put the code relevant to a page in the page rather than using templating (though I must concede that Jinja is excellent). I even started to re-learn all of the HTML that years of ChatGPT copy-pasting made me forget. You also get all of the benefits that Go has as a Web first language: the session system just blew my damn mind the first time around: I had no idea cookies without JavaScript were even a thing. Not dreading the inevitable JS blunders or the slog of having to find what part of my code is relevant was awesome.
Plus, I'm not a big framework guy, I don't like using Rails or the likes (Flask is still too pushy for me at times), so I was scared at first that Laravel was a requirement but raw, pure PHP just work, it clicked in my brain, the syntax (apart from the semicolons that aren't used for anything interesting) just clicked with me. Don't even get me started with arrays, its like they copied Lua in advance.
Anyway, what I mean to say is that PHP is a fast, easy to use, and sensical language everyone should absolutely give a shot to. I will definitely be using it in every single one of my projects for the foreseeable future.
https://redd.it/1jbe066
@r_php
For a while now my default way of building full stack web apps has been Flask + Sqlite + Whatever frontend I felt like. This usualy resulted in bloated, JS-full unmainanble mess. I have dabbled in using Go (Excellent) and Rust (Too type-happy) for my back-end but my front-end usually ended up being the thing that dragged me down. A minor epiphany of mine was discovering HTMX. But recently I got my mind blown by one of my friends who made a whole "smart map" (won't get into more detail) app whilst staying entirely Web 1.0 compliant. This prompted me to try PHP (though she was also using Flask but I didn't know it).
Honestly, the most fun I've had programming in years. In the span of an hour I had made a simple bulletin board app with nothing but html, PHP and SQL. It just blew my mind that you could put the code relevant to a page in the page rather than using templating (though I must concede that Jinja is excellent). I even started to re-learn all of the HTML that years of ChatGPT copy-pasting made me forget. You also get all of the benefits that Go has as a Web first language: the session system just blew my damn mind the first time around: I had no idea cookies without JavaScript were even a thing. Not dreading the inevitable JS blunders or the slog of having to find what part of my code is relevant was awesome.
Plus, I'm not a big framework guy, I don't like using Rails or the likes (Flask is still too pushy for me at times), so I was scared at first that Laravel was a requirement but raw, pure PHP just work, it clicked in my brain, the syntax (apart from the semicolons that aren't used for anything interesting) just clicked with me. Don't even get me started with arrays, its like they copied Lua in advance.
Anyway, what I mean to say is that PHP is a fast, easy to use, and sensical language everyone should absolutely give a shot to. I will definitely be using it in every single one of my projects for the foreseeable future.
https://redd.it/1jbe066
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Explicit nullable type vs Type Hinting
Are there any technical differences between these?
and:
https://redd.it/1jbh2ok
@r_php
Are there any technical differences between these?
public function Foo(?int $int = null) {}and:
public function Foo(int|null $int) {}https://redd.it/1jbh2ok
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
How would be a MMORPG game using PHP and Symfony?
https://postimg.cc/62bsLQtz
https://redd.it/1jbhr76
@r_php
https://postimg.cc/62bsLQtz
https://redd.it/1jbhr76
@r_php
postimg.cc
Schermata del 2025 03 14 21 46 45 — Postimages
Symfony vs Laravel - A humble request (Part 3)
https://clegginabox.co.uk/symfony-vs-laravel-a-humble-request-part-3/
https://redd.it/1jbhd4a
@r_php
https://clegginabox.co.uk/symfony-vs-laravel-a-humble-request-part-3/
https://redd.it/1jbhd4a
@r_php
Clegginabox
Symfony vs Laravel - A humble request (Part 3)
In this post I'll actually make some progress towards persisting our humble request. Before that I'm going to talk about a snake, to be more precise - Python.
Very early in my career I was really fortunate to work alongside a really experienced and patient…
Very early in my career I was really fortunate to work alongside a really experienced and patient…