5/23/2026 at 4:14:19 PM
After over two decades of working in PHP, I'm now working in Java. PHP is basically Java-lite. I am absolutely loving the compile-time safety of Java, but I dearly miss PHP's maps and arrays. In Java, the amount of verbosity for defining a map/list and operating on it is overwhelming.Modern PHP is great. Many powerful language features, excellent performance, great community and package ecosystem, and decent enough safety with modern static analysis tools.
I'm not too sure I agree with the author's complaints here. When using something like array_filter, you're typically mapping from collection to collection (i.e. you don't care about the first element--you care about the whole thing) and so this problem is really a non-issue. The next follow up step would usually be foreach, or another operation like array_map, in which case it's a non-issue.
If you really do need the first element, you can use array_first. And if you really do need a fixed-sized collection, you can use SplFixedArray.
The point on properties is valid to an extent, but IMO not really an issue you commonly run into in the real world (regardless of language, your constructors should generally return an object in a usable state).
by mfonda
5/24/2026 at 12:02:21 AM
Maps should be a first class type in every language.I have this thing I want to do in C. Now my C is very weak so my plan was to do a prototype in python, keeping in mind the C ecosystem then sit down with my old copy of "The C Programming Language" and struggle through it. Doing it with no dicts was rough.
I am normally the sort to avoid adding any libraries I don't have to but if anyone has any hints to simple hash maps in C I am all ears.
by somat
5/24/2026 at 7:41:38 AM
My first recommendation is don't use C if you can avoid it. Rust, go, zig, nim, odin, c++ etc. have hashmaps built in to the standar library or the language itself, and will have other advantages over c as well.If for some reason you absolutely need to use c, consider if you really need a hashmap. If your collection is relatively small, just use an array or linked list with linear search. That's a pattern I've seen used in several c codebases, I think because of the difficulty of using map types.
If linear search would be too slow, then a binary search tree is relatively easy to implement, and gives you log(n) lookup time (as long as it's balanced). Or if you build it up once and don't modify it very much afterwards, you can use a sorted array, with a binary search.
If you really need a hashmap, there are some implementations, but I've also seen a few c projects that just implement their own hashmaps.
by thayne
5/24/2026 at 1:04:35 AM
you may try https://github.com/nothings/stb/blob/master/stb_ds.h. a single header implementation for both dynamic array and string based hash tableby alaaalawi
5/24/2026 at 12:50:46 AM
My suggestions, none of which are particularly simple but it's C, you get what you get with a language that doesn't even know what strings and arrays are:0) use Lua with LuaJIT. It has very good C interop and native hashmaps. Downside - Lua has its own rough edges and LuaJIT is frozen at Lua 5.1 with some extensions for 5,2
1) SDL3 has a hashmap implementation with its properties API, and a general purpose hashmap that they're probably going to make public at some point maybe? Downside - overkill if you don't actually want to use the rest of the library.
2) https://github.com/tidwall/hashmap.c this seems to work fine and is the simplest hashmap implementation for C that I've seen. Downside - you still have to write a lot of boilerplate.
by krapp
5/24/2026 at 1:01:47 AM
If I remember it correctly, the "Java-lite" part comes rather late. PHP was more close to Perl and/or other old-days scripting language, it allows you to quickly launch a web page. Just <p><?php echo(htmlspecialchars($_GET['user'])); ?></p>
and you get a hello page with a parameter specifiable via `?user=` query.But then people started to actually use it to build big sites, `echo($_GET['user'])` alone is not enough, it has to be:
<?php
$user = "guest";
if (!empty($_GET['user'])) { // Have to remember to do this check everytime when handling $_GET/$_POST etc
... safety check etc etc
$user = htmlspecialchars($_GET['user'], ...more parameters...);
}
...
So people started to add module/components as well as ways to load and use those components, to enable them to write code like: <?php
use My\Beautiful\InputFilter;
use My\Beautiful\InputFilters\Integer;
function get_page_num_from_query(InputFilter $f, array $source, string $name): bool {
return $f->is_valid(new Integer(0, 100), $source, $name);
} // Or something like that, hasn't write a single line since PHP5.
That's when it got it's Java look.
by nirui
5/24/2026 at 1:04:58 AM
Namespaces were added long after that step.by hparadiz
5/24/2026 at 7:09:31 AM
>That's when it got it's Java look.Nice Java burn! But now days all you have to say to burn Java is "Lawnmower".
by DonHopkins
5/23/2026 at 4:44:15 PM
If I have an “array” and can do array[0] to get first item, but when I filter this array and array[0] throws an error, that’s super weird. What is the meaning of [] or what is an array even? The language forces me to understand how it is implemented under the hood. That’s exactly what the author says: leaky abstraction.by mdavid626
5/23/2026 at 9:05:26 PM
That also often shoots you as when json_encoding it only becomes an array when ordered "correctly" (numeric 0-based keys without gaps), otherwise an object. So to be safe you generally need to array_values after filtering. If in your testdata you only remove elements from the end you don't catch that before production data hits.To get the first element there also is reset().
I love PHP though.
by kro
5/24/2026 at 4:54:26 PM
It's especially problematic when encoding an empty object to json. By default an empty array is serialized as [], to get {} you either need to pass a flag to force object serialization (which can mess up serializing actual arrays), or cast the array as an object. Neither of which are great when the object is deeply nested in the serialized object.by thayne
5/23/2026 at 5:00:33 PM
An “array” in PHP is an ordered map.by mfonda
5/23/2026 at 6:24:11 PM
Isn't exactly their complaint? It's called an array, referred to consistently everywhere as an array, but it just ... isn't.by pavel_lishin
5/23/2026 at 10:48:18 PM
Apparently array is short for associated array:-)by yegle
5/24/2026 at 1:11:37 AM
In PHP the array index supports different key types and there's various optimizations that need to happen when the indexes are all numeric, mixed, or all strings or anything else. Technically it's called associative as soon as even one of the indexes isn't numeric. Internally though they are always numeric and anything non integer is hashed internally with DJB2 (Daniel J. Bernstein) hash algorithm and then stored. Using a non numeric index is slightly slower for that reason.by hparadiz
5/24/2026 at 7:45:50 AM
But even if you only have numeric keys, those keys don't need to be consecutive, or start at 0.by thayne
5/23/2026 at 9:28:47 PM
Better than calling it a hash.by postalrat
5/23/2026 at 10:31:37 PM
I don't think it is, tbh.Perl's hashes are a complete mystery to me still, but at least it lets me know that it's not just a linear, uh, well, array.
by pavel_lishin
5/23/2026 at 11:35:52 PM
> Perl's hashes are a complete mystery to me stillThey're unordered mappings from strings to arbitrary values ("scalars" in Perl jargon). In this sense they're just like an object in JavaScript.
Where this gets a little weird is that Perl arrays and hashes are fundamental types distinct from scalars - you can't put a hash into a $variable without taking a reference to it first, for instance. But that's more a matter of Perl being picker about the value/reference distinction than a hash-specific thing.
by duskwuff
5/24/2026 at 5:35:36 AM
PHP arrays are vectors, hash maps and doubly linked lists in oneby johannes1234321
5/24/2026 at 5:34:17 AM
> If you really do need the first element, you can use array_firstThat probably needs an array_second too, doesn't it? Maybe array_second_from_last as well?
by egeozcan
5/24/2026 at 2:47:37 PM
That's foolish. It would clearly be named `second_array_element`.by pavel_lishin
5/24/2026 at 6:54:27 AM
Just use array_values() and suddenly you can use int indicies again.by larsnystrom
5/23/2026 at 8:11:45 PM
Php has compile time safety too but compile time occurs at roughly the same time as runtime lolby kaptainscarlet
5/23/2026 at 8:21:08 PM
I'm not familiar with PHP, can you elaborate on what you mean here? What is it compiling? Or are you referring to type safety?by blanched
5/23/2026 at 10:17:12 PM
When a php file is loaded at runtime, it runs through a very basic JIT compiler that does statically check a few things before continuing with execution. Syntax, for example, is checked for the entire file during this step.Most type checking happens at runtime (this might not be true for interfaces at some level, but I can’t say for 100% certain - I just know I tend to see interface related errors earlier during code execution…). It’s perfectly valid syntax to declare a private method as returning an integer and then for the body of the method to return a string (explicitly cast as a string even). As long as you never call that method at runtime, no exceptions will be thrown.
With a half decent IDE or LSP, these sorts of runtime exceptions can be easily avoided but technically they still exist and if you don’t know about that, it can be argued to be confusing. PHP has made a lot of trade-offs to largely maintain backwards compatibility and many of them live in decisions that happen at runtime.
Modern PHP tooling can provide type safety in a very similar way to Typescript if you’re willing to put in the effort while also still technically offering you an escape hatch to do whatever the heck you want and duck type to your hearts content.
by yurishimo
5/24/2026 at 4:57:28 PM
Is there a way to run type checking ahead of time similat to typescript or python's mypy or pyright?by thayne
5/24/2026 at 12:08:16 AM
One form of type checking does happen at compile time (which is really load time in PHP, but close enough), namely when a class extends another class or implements an interface: the types of every method and property are checked to ensure that they are substitutable per the standard variance rules (return types are covariant, parameters are contravariant, props are invariant). Everything else is checked at runtime though, and statically analyzing any of those is left to external tools like phpstan, psalm, or mago.by chuckadams
5/24/2026 at 7:18:54 AM
NIT linter warning: That’s not really a JIT compiler.PHP parses the whole file and compiles it to Zend opcodes before executing it, so syntax errors are caught up front. But "JIT" means compiling an intermediate representation/opcodes into native machine code at runtime, when the functions are called, not at load time when the source file is parsed. If you just load a file and never call any of its code, the JIT compiler should never compile it.
PHP 8's OPcache JIT can do that optionally, but the normal load/parse/compile-to-opcodes step isn't JIT.
by DonHopkins
5/23/2026 at 10:20:37 PM
Have you tried Kotlin? It's a less clunky Java. The syntax is IMHO Ruby-level charming (for an OO-first lang), but with types that are quite a bit stronger than Java. Java interop is quite smooth.by flossly
5/24/2026 at 12:48:51 AM
The comparison with Ruby is spot on.I always thought that DSLs were the one thing Ruby did better than the competition, but Kotlin's combination of receiver lambdas plus syntactic sugar for calling higher-order functions make it an even better language to write DSLs in.
by pdpi
5/24/2026 at 8:08:45 AM
That's exactly how i feel about it.And the code I'm looking at now with Kotlin is so similar to code i liked reading when I was in a committed relationship with Ruby.
by flossly
5/23/2026 at 6:45:46 PM
Have you tried Lua or one of its variants?by Onavo
5/23/2026 at 7:31:22 PM
All PHP needs is python's flexible and convenient manipulation of lists/dicts/objects. Plus dropping the end semi colon and it would riiiiiiiiiiiiiiiip the fabric of spacetime.by lofaszvanitt
5/23/2026 at 8:36:28 PM
The semi colon allows you to have lots of flexibility in how you present your code, that is if you still read code, I seem to be an oddity now.by dalemhurley
5/24/2026 at 12:14:48 AM
I'd really like it if PHP switched to Perl's grammar rule where semicolon is a statement separator rather than a terminator. It already does this in a fashion within <?php ?> tags in that statements in those don't have to end with a semicolon. I think it just blindly inserts a semicolon, but that does work -- if PHP did that whenever it saw a `}` token, it should have the same effect.by chuckadams
5/23/2026 at 7:49:04 PM
yes I say this now very often, that PHP has morphed into runtime Java. Quite nice in some ways.In PHP though the STDlib is not very well thought out, it may be fun(needle,haystack) or fun(haystack,needle) and you just have to remember
empty() will do weird stuff like a string with the value "0" is also empty, so not great for parsing things.
A lot of footguns and the best way to avoid that is with a decent linter that lets you be picky
another thing I mention is avoiding the array_ stuff because of aformentioned reasons, it's easier to remember/reason about boring loops unfortunately.
by calvinmorrison
5/23/2026 at 8:49:08 PM
Why not just use a proper code editor with inlay hints, inline documentation, and autocompletion instead? These things are a non-issue, unless you’re working with Notepad++ or something.by 9dev
5/24/2026 at 1:38:01 AM
Yea VSCode or Eclipse does this.by hparadiz
5/23/2026 at 8:38:58 PM
I have worked with countless programming languages and they all have little oddities.by dalemhurley
5/23/2026 at 4:28:05 PM
> Modern PHP is great. Many powerful language features, excellent performance, great community and package ecosystemI heard this a long time ago about perl. CPAN is great.
Well ... perl entered the fossilized era. I think people do not really observe things correctly. I am noticing the same with ruby right now - everyone sees that ruby is in decline, very strongly so, in the last 3 years. Yet you have blog posts such as "ruby is not dying - it is aging like fine wine". And these are all NOT BASED ON FACTUAL ANALYSIS. I still think ruby is a great language, but if people are not realistic in their assessment of a situation, what does this tell us about people's evaluation in general? People seem to shy away from criticism. You can see this on reddit too, where moderators ban and censor willy-nilly, or even on github, where you can also quickly get eliminated for not conforming to xyz. It's as if some people are very afraid of strong opinions. I don't understand why - an opinion that is objectively false, can be shown to be false.
by shevy-java
5/23/2026 at 5:33:32 PM
People absolutely have VERY strong opinions and voice them constantly. True of every language but especially php. Almost feel like it’s more acceptable to rant about php than to praise itby chamomeal
5/23/2026 at 5:43:35 PM
I attended a talk by Rasmus Lerdorf at a FOSS conference in 2006. It has been a long time, so I remember only a few things from the talk, but one thing I remember him talking about is how people love to complain about PHP, often on forums that are themselves written in PHP.by susam
5/24/2026 at 12:17:05 AM
#include <stdstroustrupquote>
Rasmus also admits that he didn't really know what he was doing when he created PHP, and that it's a bit surprising that PHP has stayed as compatible as it has. I kind of respect him more for that than I once used to.
by chuckadams
5/23/2026 at 6:13:08 PM
Did someone reply to him with this meme? https://knowyourmeme.com/memes/we-should-improve-society-som...by internet2000
5/23/2026 at 8:17:20 PM
No, in 2006 it was still considered poor form to reply with a low-effort meme phrase instead of meaningfully criticizing his position with your own.by mh-
5/24/2026 at 1:35:22 AM
Depends entirely on the forum.I remember it being somewhat common for people to make forum posts consisting entirely of a joke image. However, they weren’t called memes at the time as the word had yet to be popularized.
by comex
5/24/2026 at 2:05:35 AM
It was not correct to interrupt a talk with a meme and it never has been.by hluska
5/24/2026 at 7:26:14 AM
But it's always been correct to interrupt a discussion on a PHP forum about PHP security by breaking into Rasmus's account and posting an ironic meme under his name.by DonHopkins
5/23/2026 at 7:29:39 PM
I know I used to have the impression of PHP as a messy language because I last worked with PHP4. It's come a long way since then, though I don't use it.by unethical_ban
5/23/2026 at 4:57:50 PM
> objectively> Ruby is dying
How exactly do you define these “objective” criteria for such sensationalism?
by xp84
5/23/2026 at 4:40:42 PM
Mate, not to be rude but your entire comment isn't based on factual analysis; it's a rant about unrelated languages.by greybeard69
5/23/2026 at 4:43:20 PM
> People seem to shy away from criticism.What actual criticism of PHP is anyone shying away from?
PHP got bashed for such a long time, while simply nothing steps up to do what it does better. Something that, for example, is available on every webhost you can just throw files at, where all (meaningful) config and state can be in those files.
by customguy
5/23/2026 at 5:18:23 PM
I used to really love the dead-simple ease PHP brought to server-side dynamic web stuff too. But when shared cpanel type hosting was orders of magnitude cheaper than anything else, that was a way bigger deal. Today you can deploy a node.js app (all the same “just a script” advantages of PHP) to a half dozen places for free, and for the next step up, a smallish instance at Hetzner, DigitalOcean or whatever, where you can just run any arbitrary container, costs less than those shared hosting once did.Why do I bring up containers? Because part of why PHP was so dope in this way was the way you can just define 1 file per endpoint and drop it in public_html, and have no server setup to do. Running say, Rails or ASP.NET or a Java site back then meant doing… a lot more, to your server.
But with Docker, you can just steal a good Dockerfile template from someone else, and it’s just like 3-4 simple files for you to manage for a simple Sinatra (Ruby) or node.js version of the “one-off PHP file” things.
by xp84
5/23/2026 at 5:57:55 PM
But I don't want to manage 3-4 files, I want to manage zero files. I don't want half a dozen hosts, I want hundreds of thousands. It's not about costs, I really mean the simplicity and pervasiveness. PHP apps that are simple (in that they don't require any "rare" modules to be enabled) can easily be written to not run in relative folder structures, you can move them around like .exe files if you will. Not "like moving an exe file and then just updating a few lines in this file over there", that is a completely different thing for me.edit: Granted, I agree that if you want to do all sorts of things on the internet, maybe PHP is not the right choice. But for simple, dynamic web things that I want to just make and then run like this forever, that I can work on but don't have to? PHP and vanilla HTML and Javascript are where it's at for me, hands down. Everything else I know is either too new or seems to have constant churn or issues. That you hear nothing about PHP other than complaining it's "outdated" or whatever from the outside -- always "why are you using this?" never "why oh why am I using this?" -- is because it just hums along, IMO. I like it better than Python, and I kinda view it as in that class.
by customguy
5/23/2026 at 8:54:52 PM
> Today you can deploy a node.js app (all the same “just a script” advantages of PHP)You still need to build a router and a web server in said nodejs script. And manage everything, including taking care that requests don't accidentally mutate global state.
PHP in contrast is stateless. Way less bs to take care about.
by mschuster91
5/23/2026 at 7:17:53 PM
I've always thought that the core idea of PHP, the intermixing of code and HTML is an incredibly elegant solution to a very difficult problem. But at the same time, the language itself does suck (although I won't discount the improvements it has made). I would really love for there to be an entirely reimagined PHP from the ground up, and to hell with backwards compatibility or availability.by Pay08
5/24/2026 at 12:40:34 AM
> I would really love for there to be an entirely reimagined PHP from the ground up, and to hell with backwards compatibility or availability.I'm halfway onboard :) That is, personally I do like that PHP is kinda "boring", it's just a programming language that mostly looks like other curly brace languages that can basically do anything I ever need to do with strings out of the box. And I like that PHP, while also adopting more advanced programming concepts, stays nice with all the simple stuff. I like the stewardship, you might say, although I don't pay any attention to it. New PHP versions always either have things I don't understand, don't care about, or really like. The performance goes steadily into the correct direction, too.
I'm sure people who know more about programming and the version history will disagree about something, but for my "low-tech" usage, it's actually one of the few happy places of computing. Not happy as in exciting, more like working in a modeset garden, without stuff blowing up constantly, and salesmen posing as flowers.
But I still would love to see and try out "takes" on that, or on what other people like about it. At least to start with, I guess it would just need to be be somewhat painless to use with with Apache, NGINX, or come with a webserver built-in. Then people can use that locally and on servers they fully control, and if it's really good, and really good with resources, basically a painless additional thing to add, web hosts might adopt it etc.
by customguy
5/23/2026 at 7:26:34 PM
There was. It was called Hack[0]. Among other things it had XHP built in so you could write HTML natively (as opposed to concatenating strings) and define your own templates easily[0]. It even handled escaping. It really improved on a ton of PHP's flaws.Unfortunately newer versions of PHP killed it and it's dead now, and even more unfortunately while PHP absorbed a lot of features from Hack, native XML was not one of them. There was even going to be a Hack version of the Composer package manager but that never got finished AFAIK. Distros stopped supporting it. I think I still have my half-finished attempt at a Hacker News fork in Hack sitting around on a hard drive somewhere. I can't even find an environment to run it in anymore.
by krapp
5/24/2026 at 12:24:21 AM
XHP was a modified PHP before Hack came about, but only Hack supports it now. XHP did have a longer reach though: JSX is its direct descendant.by chuckadams
5/24/2026 at 12:52:04 AM
Making it an extension rather than default was a mistake on PHP's part. 99% of PHP is being run on shared servers and most people cant recompile it, and most of the rest just won't.Having a language whose entire purpose is to be a templating language for HTML have no concept of what HTML is, is just ridiculous. You have to use a templating framework that rolls its own ad-hoc DSL and parser to manage context just to make PHP do what it should be able to do safely and sanely out of the box.
It doesn't matter now, since "web dev" is whatever JS vibe-coded nonsense Claude shits out and no one cares anymore, but ye gods it could have been so much better.
by krapp
5/24/2026 at 1:08:34 AM
It was never any kind of official extension, it was an outright fork of PHP (it changed the grammar) and FB never really attempted to push it to core, or really engage with PHP's core dev process in any way. PHP came about in the era of server-side includes, and expecting it to have grokked the DOM structure out of the box is just hindsight.Anyway, I don't even think about server-side rendering anymore, and for the last few days have had Claude "shitting out" Vue components that replace legacy Bootstrap 3 components with html5 alternatives for my PHP app to use via Inertia.js. The axe-grinding is not helpful to either of us.
by chuckadams
5/24/2026 at 1:37:04 AM
Lol to true. Who even uses twig or smarty anymore hesitantly raises handby hparadiz
5/24/2026 at 7:50:20 AM
I have a client I've been working with for decades (because they're great people to work with), maintaining and improving their php code base that still uses Smarty templates. So I know and hate Smarty from first hand experience, and appreciate what a terrible idea Smarty is and why.I've also extensively used Zope and Plone, which attempt to give designers a "safe" set of capabilities and subset of Python which was a total disaster. Template DSLs always end up trying to regrow programming language features, much usually worse then the languages they are implemented in.
Zope is particularly illustrative because it recursively accumulated: TAL, METAL, TALES, RestrictedPython, and DTML: all to avoid "just use Python templates". (And don't even get me started on all the layers CMF and Plone introduced!)
This happened with Smarty, Zope Page Templates (ZPT), TAL/METAL, RestrictedPython, Django templates, Helm templates, Jenkins pipelines, GitHub Actions YAML, Terraform HCL, and countless other attempts to create a "safe non-programmer-friendly mini-language" that eventually mutates into a worse programming language, often with horribly leaky abstraction layers of \escaping and < perfect syntax and <![CDATA[ cruft.
I Wanna Be <![CDATA[ (Sung to the tune of "I Wanna Be Sedated", with apologies to The Ramones):
https://donhopkins.medium.com/i-wanna-be-cdata-3406e14d4f21
https://news.ycombinator.com/item?id=32886424
This attitude causes disasters like PHP's "Smarty" templating language.
PHP was already a templating language, but somebody got it in their head that there should be an iron-clad separation between designers and programmers, and that PHP gave designers too much power and confused them, and that their incompetent untrustworthy designers who refused to learn anything about programming deserved something even "simpler" than PHP, so they came up with Smarty.
Then over time the realized that their designers were powerless, so their programmers would have to learn TWO languages so they could wade into the Smarty templates to make them actually work with all the extra code they had to write because Smarty was so crippled, so they nickle-and-dimed more and more incoherent programming language elements into Smarty, making it EVEN HARDER to use and more complicated and less consistent than PHP, yet nowhere near as powerful.
https://news.ycombinator.com/item?id=20736574
DonHopkins on Aug 19, 2019 | parent | context | favorite | on: YAML: Probably not so great after all
One of the most ridiculous examples of this was the Smarty templating language for PHP.
Somebody got the silly idea in their head of implementing a templating language in PHP, even though PHP is ALREADY a templating language. So they took out all the useful features of PHP, then stuck a few of them back in with even goofier inconsistent hard-to-learn syntax, in a way that required a code generation step, and made templates absolutely impossible to debug.
So in the end your template programmers need to know something just as difficult as PHP itself, yet even more esoteric and less well documented, and it doesn't even end up saving PHP programmers any time, either.
https://web.archive.org/web/20100226023855/http://lutt.se/bl...
>Bad things you accomplish when using Smarty:
>Adding a second language to program in, and increasing the complexity. And the language is not well spread at all, allthough it is’nt hard to learn.
>Not really making the code more readable for the designer.
>You include a lot of code which, in my eyes, is just overkill (more code to parse means slower sites).
https://web.archive.org/web/20090227001433/http://www.rantin...
>Most people would argue, that Smarty is a good solution for templating. I really can’t see any valid reasons, that that is so. Specially since “Templating” and “Language” should never be in the same statement. Let alone one word after another. People are telling me, that Smarty is “better for designers, since they don’t need to learn PHP!”. Wait. What? You’re not learning one programming language, but you’re learning some other? What’s the point in that, anyway? Do us all a favour, and just think the next time you issue that statement, okay?
http://www.ianbicking.org/php-ghetto.html
>I think the Broken Windows theory applies here. PHP is such a load of crap, right down to the standard library, that it creates a culture where it's acceptable to write horrible code. The bugs and security holes are so common, it doesn't seem so important to keep everything in order and audited. Fixes get applied wholesale, with monstrosities like magic quotes. It's like a shoot-first-ask-questions-later policing policy -- sure some apps get messed up, but maybe you catch a few attacks in the process. It's what happened when the language designers gave up. Maybe with PHP 5 they are trying to clean up the neighborhood, but that doesn't change the fact when you program in PHP you are programming in a dump.
by DonHopkins
5/24/2026 at 2:34:48 AM
> PHP came about in the era of server-side includes, and expecting it to have grokked the DOM structure out of the box is just hindsight.Obviously not from the beginning. But by the time template frameworks like Twig came around it should have been possible. If it can be done at runtime it's possible to build into the language proper. And I'm specifically talking about the time when PHP 7 started taking other features from Hack.
I'm not grinding an axe here, i'm just stating an opinion.
by krapp
5/24/2026 at 8:08:50 AM
I've seen the PHP Hammer, and I'd hate to see a PHP Axe: it's probably all dull blades, no handle!https://blog.codinghorror.com/the-php-singularity/
https://web.archive.org/web/20120711143431/http://me.veekun....
by DonHopkins
5/23/2026 at 5:07:07 PM
You can say the same thing about lisp (and C in some regards). Sometimes a language is done and anything you add to it is breaking things for no sizable improvement. And if your primary target is Unix, it’s often so easy to write a shim for C/C++ libraries that you don’t bother implementing your own version of stuff.by skydhash
5/23/2026 at 7:23:36 PM
Which lisp? :Pby Pay08