Maybe the things they've added lately have been well designed, but did they ever actually fix the WTFs from PHP 4?
JavaScript has the same problem. They added `let` and `const` but never removed `var` or `==`. If you take a look at ESLint rules there are dozens of footguns that could have been fixed in the language. Not as bad as PHP's footguns, but still...
IMHO, although its improved A LOT it’s still a mess. But with the right tooling you can kinda-sorta make it behave like a sane language if you squint a bit.
I'd love to see a PHP without the warts. Something that is trivial to embed in a web page just the way PHP is but without the foot guns.
There should be a name for the "nothing is perfect so everything is equally bad" fallacy. It's surprisingly common.
https://www.greaterwrong.com/posts/dLJv2CoRCgeC2mPgj/the-fal...
> The Sophisticate: “The world isn’t black and white. No one does pure good or pure bad. It’s all gray. Therefore, no one is better than anyone else.”
> The Zetet: “Knowing only gray, you conclude that all grays are the same shade. You mock the simplicity of the two-color view, yet you replace it with a one-color view . . .”
> —Marc Stiegler, David’s Sling
I think this falls under splitting (black-and-white thinking), a form of defense mechanism or (I suspect) mere rhetorical tool.
What can be confusing is mixed lifetimes of nested generators using `yield from`. If any outer generator has a shorter lifetime, when it is garbage collected `yield from` will forward `close()` to the inner generator. Attempting to re-use the inner generator will result in a premature `StopIteration`. Iterators do not have `close()` and so are unaffected. This affects only `yield from` and not `for i in gen: yield i`.
The one I'm talking about is the fallacy of grey, linked from a sibling comment.
Usually happens through tacking on new features and standard API functions without removing old ones. I wish modern languages would allow different modules within the same project to use different versions of the language and be more aggressive about deprecating/removing old features.
So like if you open a module and see "version 3.0" in the manifest you know for sure that this module is not using stupid feature X from version 1.0. While still being able to use "crucial library not updated since 2003" without much fuss.
Most languages these days don't dare to change core syntax behaviour in order to not break backwards compatibility.
Java is probably the longest lasting language that I would consider good. Are there things that I hate about it? Of course. But it got a lot of things right - even things that more modern languages have done much worse at, like IDE support.
What do you mean? The time & date API in Java is excellent, and the float and double types follow the IEEE standard.
Dunno what's up with getYear() though!
95 = 1995
96 = 1996
97 = 1997
98 = 1998
99 = 1999
100 = 2000 !?If you have a background in C programming, most of the "wtf" is completely reasonable - the only thing "modern" and novice PHP programmers will still raise the WTF flag about is the standard library, mostly the string manipulation functions, their names and argument order. Old dogs know that this comes from early PHP being not much more than a thin wrapper around libc and various other C libraries.
Other than that, if you write modern PHP it's almost like Java, just without threads/concurrency in general, and without extremely braindead tooling required to get something built. PHP Composer is a breeze compared to Gradle, Maven and messing around with Tomcat, Glassfish and classpaths to get your application deployed...
Honestly 90% of web apps could be easily built with PHP, Laravel, Inertia and React/Vue in half the time.
Also, you still run artisan to view your code after you save. Same thing with Python's FastAPI: I run FastAPI's server. I just save my code just like PHP.
If webpages from 30 years ago stopped working because 2025 developers favor aesthetics and disrespect legacy, I'd be pretty angry.
Mostly though I don't care if we break old stuff. It happened all the time when developing for the desktop. People just dealt with it. The ones most impacted are lazy enterprises and I have no sympathy for them.
Clinging on to the past stifles innovation.
If you start telling people they have to install an obsolete web browser, and then an obsolete operating system, and then patch the drivers because all the hardware doesn't support it anymore, you have effectively gatekept information that was once available in the open web to the tech elite.
Yes, "tech" is redone from scratch every 6 months so 5 years ago is an eternity, but there are plenty of fields where 30 year old information is just as invaluable as something published today.
Nobody is maintaining webpages published in the 90's. Nobody is going to update them. They are just there, sitting on some university's server that barely gets any hits. The author probably died 12 years ago and nobody even remembers who is responsible for it or that it's running. And it's in everyone's best interest to keep it that way: online.
The reality is that we have already given up in many areas, try and run a 16 bit Windows application on Windows 11, try and run a Node app you haven't updated for ten years, try and run early versions of OS/X and see how much internet dependent functionality has been lost, try and view an email with linked assets, try and run a web page with a Java or Flash applet.
And we can't tell how valuable it is because we don't know what we are losing.
If we burn down the Library of Alexandria, was there anything valuable in there? We don't know, because it's all burned. It's inaccessible. It's too much stuff to verify before doing it, and we can't tell after we do it, so I'd rather we don't burn down the whole thing since we don't know what's inside.
And every time it does happen, it's a massive loss.
You have no idea how much I grief the fact flash games are no longer a thing. If newgrounds still had flash today, the Internet would be a much better place.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
How does something like this even happens.
Anyway, if you "use" strict mode, but the browser doesn't support it, you're effectively not running in strict mode, so you can't actually assume the Javascript will execute differently.
0777 style octal numbers are a footguns inherited from C. Don't ask my why they made that mistake! Modern languages use 0o777.
We could implement a version declaration system that removes and fixes elements of JavaScript when properly declared.
Depends what you class as a WTF. The older parts of the standard library are still wildly inconsistent in function naming and argument order, but that’s never going to change because it’s simply not worth the BC break.
But they’ve done a good job cleaning up the actually problematic bits of the language. Previous horribly insecure defaults like register_globals and magic quotes are long gone. And in recent years they’ve worked on tightening things up: many obviously incorrect behaviours have been promoted from notices or warnings to outright errors.
It might take a while to enumerate them all ;)
I really have very little annoyance with PHP despite retaining some WTFs. In fact, with a modern language server and psalm I find it downright comfortable.
It's easy to use, easy to get into for beginners, and is a requirement for WordPress. But performance? Flexibility? Some other random metric-word?
1) Easy hotfixing/debugging on production servers. Just edit a file and save. Our teams which program in PHP solve blockers way faster than the Go teams.
2) "Shared nothing" architecture, which has two advantages:
a) it's scalable without additional effort, because PHP processes are stateless
b) better security, especially if you're doing multitenant SaaS, because all requests are isolated from each other (there was a bug in ChatGPT when you could view chats of other users because requests from different users were served by the same OS process in Python and they had a race condition bug when switching between users inside the same OS process - such bugs are very rare in PHP)
Not saying it's unique to PHP, but these 2 advantages for real production code are often overlooked; people instead focus on non-essential minutiae like "inconsistent function name, I'd name it differently tbh"
For my company: minor apps with laxe requirements, hotfixes usually involve editing a single file, in place, then push to Git. We don't have "serious" apps in PHP, but we have a few low tier apps using it, it's simple and convenient.
It's been ages since I've last seen Delphi in real life - must be over 20 years ago by now.
But I'd not put PHP in the same league of "dead and bad" with it... yes, it's not the "hipster" language these days, that's been taken over by <insert JS framework of the day> in frontend, NodeJS in the backend and Go for "need to quickly cobble something together"... but it still powers dominant parts of the web. Obviously Wordpress, Typo3 and Drupal in the CMS area which power a large amount of individual websites, and then the large behemoths Facebook, Wikipedia and Fandom/Wikia.
It's dead to the extent that you are unlikely to start a new project in it but I wouldn't classify it as bad. It's just of it's time.
Agreed! Also, typically far lower memory usage.
The catch? I don't know Pascal, and there is no way to learn it. There are so many versions of Pascal that every tutorial you find will be about a different version. The GUI tutorials are for Borland Delphi, not Lazarus. There is no documentation or recipes for doing basic things, e.g. if you want to make a simple to do list CRUD that adds items to a list, you have no idea which widget is the correct list widget. Normally in this case you have a model-view list and a string list. Doing anything with lists that have columns is often a confusing nightmare, but and it becomes even more confusing with no documentation about it.
On the forums, the recommendation is to just press F1 in the source code editor to read the documentation for a function, but that doesn't help you when you have no idea what function you need to call, and you won't know it often. How do you append an item to an array, for example. How do you REMOVE an item. Is there a splice function? A remove function? Where are the dynamic arrays. Is there something like classes, and if not, how are you supposed to organize objects that you want to instantiate. How the lifetime of things work. Every time you ask "is this the correct way to do it using this tool?" you'll have no answers. How do you structure your project? It's completely different from how modern languages work and from how even C works.
> Why: There are many books and resources about Pascal out there, but too many of them talk about the old Pascal, without classes, units or generics. So I wrote this quick introduction to what I call modern Object Pascal.
Beauty in languages or tool chains is one thing, but the satisfaction of solving an issue for someone within some weird constraints for whatever reasons is real.
5. Poor coding practices can produce unmaintainable code in any language.
The pain of the maintenance programmer is caused by the implementation programmer, not the implementation language.
Languages don't die, they ride into the sunset. There is enough inertia in PHP-ecosystem that you can still find jobs, but they are very often just legacy work jobs (at least in my area). No serious technical leader would pick PHP to execute on new work, except of course, if their main driver is to pay as little as possible and the language choice doesn't bubble up to investors' keyword-driven investment thesis.
VB6 and PHP are nice. I am skeptical of the affirmation that there is a lot of money in these ecosystems. The pie may be currently large, but I do not see it growing.
And there are three things I learned about it
1. There is a lot more money in it than you would think. The good part of "there is a lot of newbie using it" is that there is a lot of newbie using it and tons of software in it out there, and once you prove you know what you're doing you drown in high paid work, and with a bit of job selection it's not the bad horrible maintenance kind but decent fun too.
2. There is no need trying to argue with people about it online or whatever. You're not going to convince anyone they're better language than they think. PHP 8 is a top notch language and people are still dumping on it using php 4 things.
3. Ultimately there are people who spend their time talking about what language is right and people who get things done, build something great and it doesn't matter if it's cpp or Javascript or whatever. So at the end of day I've made a fair bit of money improving or building stuff used by lots of people to generate tons of revenue, and everyone involved is happy about it.