PHP Docker image just hit 1B pulls on Docker Hub
mydevmentor.com
mydevmentor.com
I honestly have not met, in real life, anyone that has thought PHP is dead. People that hated PHP? Oh yeah, I've met plenty of such people, often from using it in anger in pre-7+ days. And, (to be fair) for a language nerd, even new PHP is not exactly an exciting language. It's productive, but so very far from glamorous.
But dead? How can it be? Wordpress is an absolute behemoth. Laravel is large. Symphony finds plenty of use in the biggishOrg space. Even Drupal is not dead. Who in their right mind could think it's dead?
BTW, my loathing of earlier versions don't carry through to now. I haven't had to look at it in a couple decades and maybe it's better now. I was strongly in the hater camp, based on my own personal experiences with it, around the time JS was starting to become a thing.
``` for repo in node python php ruby golang; do
echo "${repo}: $(curl "https://hub.docker.com/v2/repositories/library/$repo" -H 'Accept: application/json' -s | jq .pull_count)"
donenode: 5457781829
python: 7821948426
php: 1208701378
ruby: 1468243407
golang: 2272339163 ```
Or: it's the last in line for these alternatives.
Also, containers build on other containers. E.g. the highly popular phpmyadmin or nextcloud images build on top of php. So each "nextcloud" pull, will result in a pull for php too. Are those developers? Does that mean hundreds of millions less pulls?
PHP was always the most in-demand tech for backend development, and of course, this includes frameworks like Laravel and Symfony.
So yes, PHP is thriving.
It doesn’t mean that other languages are bad or something that’s ridiculous.
this is just to answer the "PHP is dead" folks
Every language has its place, and they all have their strengths in different contexts.
Is usage growing?
How many new projects are being started with it relatively to other languages?
I certainly don't think it's dead but it probably peaked 10-15 years ago.
It is probably past its growth phase, nothing wrong with that. There is a very long list of languages that are arguably "better" that will never have a fraction of the success PHP enjoyed, will never see thr growth PHP saw, and will never be as widely used.
I don't even like PHP btw. But the HN crowd has some very warped view of how things actually are when it comes to programming languages and how popular/successful they are.
To be even more honest, I never thought that PHP was dying, but I often thought it should not be used for new projects.
Previous job was in a very PHP-oriented company and it was just a Java alternative, the only advantage being the edit and refresh page dev cycle, and being worse in every other way. Perhaps Laravel could have changed my mind, as most devs there hated Laravel because of the magic (some then proceeded to implement control flows with typed exception throwing so maybe not the greatest bunch to discuss such things)
https://wellfound.com/startups/tech/php
I believe a good developer chooses technologies based on use case and requirements, not emotions.
All technologies can coexist effectively.
Personally, I use PHP, Node.js, and other like Python for different scenarios, selecting the best fit for each project's needs.
You now add an anecdotal evidence to underpin the "PHP is thriving". Which also is not a good argument.
That is not to say "haha php ded" - I'm merely and only making the point that in order to show that PHP is doing good, you need good arguments. Not a download stat, that on closer inspection, shows it's not really thriving, nor a story from your last job.
I also believe PHP still has its place. But haven't seen any solid evidence or arguments that this is the case and will remain the case.
I think each nextcloud build will pull the base PHP image. Ordinary pulls of nextcloud will not trigger a build but will pull the nextcloud built image. So If I built an image called "A" on top of "B" then 100 person pulled "A" then will not mean that "B" gets 100 pull. This is still one pull for "B" (assuming I did everything right from first time).
When pulling images from dockerhub that are based on other images, the image is rebuilt from scratch each time? That doesn't sound right.
That's not what parent is saying.
A Dockerfile usually start off with a base image, like:
FROM php
This will pull the php base image, which is already built and published, from dockerhub.I guess this makes sense if you are familiar with Docker.
If foolang image has:
layer c
layer d
layer e
And then fooadmin image is FROM foolang:latest (and the more stuff) and builds the layers: layer f
layer g
... then a user pulling fooadmin pulls layers g,f,e,d,c,b,a (b and a being layers provided by the image that foolang was built on top of).The question is then "does the pull of layer e in docker pull foo admin count as part of docker pull foolang?"
It doesn't.
Not only are those keys not nearly as accessible as the humble `.` but there’s literally 100% more keys to type than a simple period.
I know it’s pedantic and stupid but I hate it.
Sometimes syntax disdain can become prejudice towards the users of that language if left unchecked.
I try to remind myself that most customers or end users don’t see or care.
Double scoldings for building a vast temple of a stack to ones own veneration.
The perl design choice can be seen in https://perlmaven.com/what-are-string-and-numeric-contexts
https://perldoc.perl.org/perlop#Additive-Operators
Though php doesn't have the numeric vs string contexts (it just is) which can change how perl behaves.
---
There is a bug in php with the lack of string vs numeric contexts can be seen in https://ideone.com/UntiCW where the lack of a numericy vs stringy data difference creates an interesting bug when trying to replicate the magic of perl's ++ auto-increment on strings ( https://perldoc.perl.org/perlop#Auto-increment-and-Auto-decr... )
This doesn't exist in perl since "3d7" is a numericy value and "3d7"++ becomes "4". The "d9"++ becoming "e0" only works if it's a stringy value.
> The auto-increment operator has a little extra builtin magic to it. If you increment a variable that is numeric, or that has ever been used in a numeric context, you get a normal increment. If, however, the variable has been used in only string contexts since it was set, and has a value that is not the empty string and matches the pattern /^[a-zA-Z][0-9]\z/, the increment is done as a string, preserving each character within its range, with carry ...
Besides, you probably access objects 10x more often than you concatenate strings manually. Way more often that I’m doing some sort of string split, filter, join.
Doesn’t JS have => ? Isn’t that -> plus an extra key press? (Shift?)
so that sum is '12'? it happens all the time when reading from the DOM and you fail to parseInt/parseFloat.
(I’m sure they had valid reasons for picking \. I don’t think they’re dumb. But seriously, I’d rather use an emoji or something instead. At least then code wouldn’t look like it’s full of escape sequences.)
I think Composer & Laravel really drove PHP's evolution.
And Nikic's contributions as well of course.
curl "https://hub.docker.com/v2/repositories/library/php" -H 'Accept: application/json' -s
curl "https://hub.docker.com/v2/repositories/library/wordpress" -H 'Accept: application/json' -s
There's probably a lot of overlap...The worst part is it doesn't have zero downtime deploys. Requests to the old version are killed when a new version of a site becomes active.
None of this is related to PHP though.
1. You can dynamically load code as you go. This alone allows Wordpress to download and use plugins straight away. You can't do this with Go and it's not as simple with Python.
2. The shared nothing architecture means it's almost trivial to scale out.
3. It's a language easy to pick up and the absence to watch directories and hot reload code gives it the fastest dev experience ever.
Modern PHP looks like Java, without the performance.
The most surprising thing about this is that PHP developers are using Docker, I would have guessed that most of them are on bare metal or shared hosting. But I guess some of them also like modern deployment methods.
Did you think of us as living in a cave forced to connect to a BBS to share the latest on design patterns?
Like if you use C# you obviously value structure and organization over many other things and aren't afraid of spending money, so deploying everything on your inhouse Kubernetes cluster makes perfect sense. If you use JavaScript you probably have some kind of compile step, and after deploying you need to somehow restart node anyways; Docker makes this easier and more reliable. But if you use PHP the relative advantage of Docker over rsync isn't nearly as big, but Docker adds a lot of incidental complexity.
And if you are small enough you probably want some kind of serverless hosting. With most languages that involves running a tool that creates a docker image and uploads it to that provider. PHP invented that a couple decades earlier and called it shared hosting. It's not as cool and has worse versioning, but functionally it fulfills the same purpose. It just happens to predate docker.
What do you mean?
I think you tend to get good value for your money, developer salaries are expensive after all. But for any other language (maybe besides C/C++) this is much less common and the paid products that do exist are much cheaper.
How does this relate to docker? Only really in combination with the other attributes. Rsyncing files into production isn't as traceable, organized, structured or auditable as many of the Docker-based solutions out there. Those solutions can get expensive at scale, but if you use C# you are used to that
Wordpress's dockerfile pulls PHP.
Js, Python, Go, php, C, C++, Rust, zig, Odin, etc
We’re in a Cambrian explosion of programming languages!