Many of the quirks and problematic parts have been addressed through the years, it's battle tested, and there is a healthy and stable ecosystem behind. It doesn't need to be everyone's first choice, but there's also no strong reason to avoid using it in its current state.
Because it's good enough for almost everything. The vast majority of projects will never have to scale to billions of users, so hyperscalability is not a huge concern.
It has a low barrier to entry and great language features - static typing being one of the big ones. It has become a really nice language over the years, great to work in and in no way less satisfying or effective than for example golang.
> The vast majority of projects will never have to scale to billions of users, so hyperscalability is not a huge concern.
I would have thought PHP would scale very well. It may not be high performance, but its start each request-response cycle from scratch should scale horizontally very well, surely?
It does. But scaling to billions of users (or billions of requests per day) is still not easy and you really need high performance for that. Laravel scales to a certain point, where their design decisions (eloquent, the queuing system etc.) are still working.
That said, with today's PHP it is possible to optimize the hot path pretty well with stuff like FFI.
> It has a low barrier to entry and great language features - static typing being one of the big ones
... and it's completely optional in many cases on top of that. Even if you're using third party libraries, it will only crash if you mess up your types at the library's interface.
I worked at a company that had half C#, half PHP developers. The PHP developers ran circles around them both in building features, and in fixing vulnerabilities (I was hired for a reason, legacy code). I can always depend on a PHP developer to outrun anyone else.
By the time a large C# solution finishes compiling, the PHP Dev already started another ticket and is pressing F5 to insta check if his code works so he can move to the third ticket of the day.
This hurts because it’s true and sometimes I’m jealous of the build kids who get to work on tiny features all day while I’m switching back and forth with a browser. I know native has its own challenges (looking at Apple here with the imminent redesign that will stop all product teams in their tracks) but it still doesn’t mean I’m not jealous sometimes
TL;DR Your dad's PHP is no longer the current PHP. The language itself has been thoroughly modernized, made more consistent, bug free and performant. There is nothing better than a piece of software that keeps getting improved decade after decade borne out of real developer needs and experience.
- Type annotations are integrated and work well with PHP now. This results in a kind of scripty Java OOP that is more succinct and type checked ! (it is possible to write PHP without types when you want metaprogramming features also)
- Many inconsistencies in the design of the language (OOP, function naming etc.) have been resolved/smoothed out
- The language recognises the inherent problems with `null` and allows you to make type annotations that rule out null. This is my smell test for a language BTW -- golang for instance does not seem to have a good story for null.
- PHP Language developers have been really good about increasing performance year after year
- Lots of software like web frameworks and CMSes continue to be based on PHP
And -- the greatest part of the design -- PHP remains the best example of the "shared nothing" architecture. An architecture that allows you to scale your application easily.
Build something with symfony or laravel. In this space PHP is used in the modern way. Don't look at WordPress, Pimcore, WooCommerce et al. They're pretty much stuck with old PHP.
That said, you can still shoot yourself in the foot with PHP. The dark alleys are all still there.
Yep, nuclear batteries. Laravel and the whole PHP ecosystem is just so much ahead of any other programming language when it comes to building websites and APIs it's insane.
As mentioned by others, PHP today is not the PHP that is still in most peoples heads.
For me one of the big advantages is ease of deployment.
No docker, no images, no overhead, scp it to any toaster running apache and you are done!
Because I‘m good in it. And my clients don‘t depend on me - they can choose to continue working with me not because I‘m the only one who knows how the language works, but because they WANT to.
While this is true, I would say that your advice only applies if you have experience with other web frameworks from other languages. If you’re coming at it blind to any sort of web development, the features afforded to you by a web framework are really useful and helpful to understand.
For example, imagine someone who had never really thought about routing in a definitions file versus file based versus annotations. Three valid use cases that might not exist if if you have a background in something like hardware or if you come from a non-programming discipline.
If you do have that experience, you can rebuild almost any affordance in PHP at this point and it purely comes down to personal preference and how you like to write and design with code.