PHP Array Shapes - potential RFC, looking for feedback
I used AI to draft an implementation of PHP array shapes. I used Claude to implement the idea i C source - I want to get it out there, full transparency. Reason I'm posting here: I'd like to see if this is something people would even want in PHP or not. These are extension to PHP's type system enabl...
Extending type system so we can define array shape, i.e. a way to express that array returned by function will contain instances of specific class.
Real impact:
Chainguard - assholes.
Ondrej Sury - MVP.
I've been using MySQL since 1999. One of the things that disgusts me the most is IT "experts" writing or stating claims that are untrue.
Before you make a switch from X to Y, you need to ask yourself what is it that you expect to gain.
There are two valid reasons for switching from X to Y:
MySQL 8.0 is an amazing RDBMS. I won't list MySQL vs Postgres, Postgres is amazing too, but it's sufficient to say I'm working with MySQL databases that are in petabyte range. It does the job, if you know what you're doing. There's no software that will correct inherently stupid, incapable or uneducated person.
Don't listen to opinions blindly. Try the software yourself. If you like it, use it. In my opinion, liking something is the best reason to use it.
This was THE feature of PHP. Quick info - I'm one of the dinosaurs who used PHP since version 4. Autoloading literally changed everything and no feature so far comes even close to what impact autoloading had.
With namespaces and autoloading, we got insane feature and then Composer made the best autoloader which we all use even today.
Compared to other stacks I work with, this is my favorite language feature and it's simply beautiful and something that relieved the most annoyances (for me).
Spot on. I expected something else but you hit the nail on the head. Marketing. Modern website. Pay for people to maintain docs. There's a ton of good and bad knowledge hidden in comments in the old docs.
People who ask how to learn PHP - the docs should be the go-to resource, but they're too dry to read and not friendly to everyone, it's difficult to get an idea how to do something even if one understands how it's done in a different language.
There's a whole depth to PHP, the extensions - it's a forgotten land nowadays, but that's another topic completely.
+1 for this Brendt, very nice - love that you kept it so short that everyone can read it in a single breath, great writing!