by elric · 6y ago · 0 comments
Is it a perfect language? No. But which language is? (I can hear the Lisp crowd grumbling.) It's fast. The only ceremony you need to write executable code is the <?php tag. It has a very rich standard library -- even if some of the function names make me want to stab people.
My only real gripe with PHP is the annotation syntax. Yikes. Stuff that's in comments SHOULD NOT AFFECT RUNNING CODE. Who came up with that?
PHP has taken a lot of flack over the years. Mostly from people who never really worked with it. A lot of the criticism really should have been aimed at certain PHP developers, rather than the language or the community at large. PHP's low entry barrier is a blessing, it's how a lot of developers were introduced to programming. It's also a curse, because a lot of very inexperienced programmers managed to become prolific at getting code out there, code which was ugly, bug infested and a security nightmare. But it's not fair to attack a language over its inexperienced users.
I've used PHP in earnest. It and JavaScript are tied for worst programming languages I've used. JavaScript gets more of a "pass" from me because I'm just not a dynamic-typing fan and I'll admit that it might be less awful for someone who enjoys/prefers Python or Ruby or whatever.
PHP, on the other hand, is basically just worse-Java. And Java isn't a great language, either. The built-in PHP array is a constant source of frustration. Keys are sometimes strings, sometimes ints. And you don't always know which it is! This makes working with the array_* functions cumbersome at best. The fact that you can't typehint everywhere also sucks. No generics sucks. No threads sucks. No (real) async sucks. Globals suck (including different language behavior based on a config file on your machine...........).
It's just not a strong language. And I'm super-tired of hearing "it's not the tool, it's the user." There is such a thing as a shitty tool. And just because some human somewhere CAN write working code in Brainfuck, does NOT mean that anybody SHOULD. I'm similarly tired of "all languages have warts". Do I even need to actually explain the fallacy there?
On the other hand, I agree 100% that PHP's deployment story is awesome! But is that because PHP did anything useful, or because Apache and Nginx support PHP out of the box?
I get that people that have grown up with the language, or folks who have used it full time for years, don't see these blemishes as that big of a deal. But to newcomers, or folks from other languages, it's an affront. I hate to pile on an old, worn out issue but, as a language designer/implementer, the moment you start working on `mysql_real_escape_string()`, a huge warning bell should have gone off! I'm fine if people want to question my competence in writing code. It happens all the time on HN. I've been at it for 20 years... so some rando telling me that I don't know what I'm doing is pretty common. What we find in PHP though is quite a bit of tribal/tacit knowledge. And it's wrong to blame the user.
PHP isn’t perfect. As OP said, no language is, and any competent software engineer uses the parts of the language that work well for them, and just ignores the things that don’t work for them. I don’t believe for a second that the abuse the language has suffered over the years has anything to do with mysql_real_escape_string, it’s more to do with crappy code. You can write crappy code in any language, and it’s more a reflection of the programmer than the programming language IMHO.
Part of PHP’s problem is that it’s so easy to use. Any C programmer can pick up the basics pretty easily, hack together something that scratches an itch, and move on. Later someone will criticize the quick hack and say “you didn’t use mysql_real_escape_string so that code has a SQL vulnerability. Don’t use PHP”. In reality, there are mechanisms for preventing SQL injection and they just weren’t used. Is that a failing of the language ? Partly, perhaps, for providing the unsafe way of doing things, but a lot of blame also lies with the coder.
I’ll admit to a soft spot for PHP - I was putting database-driven websites on the web when that wasn’t much of a thing (back in 1981, if foggy memory recalls true). I wrote the asset management system that was used by Lucasfilm on Star Wars, by Manix on the Matrix, by various post-production houses in Soho, etc. etc. - all in PHP. We had video-streaming from remote locations before RealNetworks were mainstream. All because of PHP.
I also used PHP to write a content management system for the RiskWaters Group - around 100 magazines in the CMS, with forums, mailmerge, access-rights per page or per view-count or per time-period, with back-end admin pages, with macros the editors could use, etc. etc.
Used properly and judiciously, PHP is a powerful tool. It comes with a few areas that ought to be marked ‘here be dragons’, but frankly so do most languages.
These days, I mostly use PHP for shell-scripting (it comes installed as standard on my Mac), nothing so grandiose as the halcyon days of yore, but I still have PHP to thank for getting the job I’ve had for the last 15 years, in R&D at Apple (“these are the guys that Lucas was talking about”, said the VP who bought my small company).
I’ll finish with a line from a song “Baby, life’s what you make it, celebrate it”. That applies to PHP as well.
1. You can write bad code in any language.
2. All languages have warts.
My response to #1: Here is a rock. Please use it, with some nails, to hang a bunch of pictures on your walls. Don't complain about your tool because it's entirely possible to use it successfully at this task. Or, less sarcastically, why use a tool that encourages bad results when you can use a tool that nudges you toward better results?
My response to #2: Would you rather have one wart, or 100 warts?
You've made my point. A person with tribal knowledge probably would NOT. Any new user coming from reading an older blog post or perhaps a PHP book would have no idea that that "older approach" is out of date.
Furthermore, the more precise point I was trying to make there was as a language designer, how on earth would you be okay implementing something like that? (Remove my example of `mysql_read_escape_string()` and insert any of the more WTF features of PHP.
Lastly, see my comment about being able to build meaningful, fast, cool things with PHP. I never want to tear down anyone's hard work. (Rasmus/Zeev/etc included).
https://news.ycombinator.com/item?id=14178993
>The act of trying to connect an even socket to another even socket, or an odd socket to another odd socket, was considered a "peculiar error" called "homosocketuality", which was strictly forbidden by internet protocols, and mandatory "heterosocketuality" was called the "Anita Bryant feature" [2].
https://www.saildart.org/allow/IMPSER.DOC%5bSS,SYS%5d
>Illegal gender in RFC, host hhh/iii, link 0
>The host is trying to engage us in homosocketuality. Since this is against the laws of God and ARPA, we naturally refuse to consent to it.
What is a 'powerful' programming language?
It is NOT okay that `foreach` leaves an allocated reference to the loop-local value.
Why are you building arrays with mixed key types?
Why do you want type hints?
Why do you need generics in a dynamically typed language?
Php has pthreads. They just arent needed that often.
Async is being worked on You didnt mention it but immutable types are also being worked on.
Everything people complain about php over tends to actually make its way into the language eventually.
I dont know when you tried php, but I dont really think it was in earnest. It sounds like you had problems keeping your types straight.
I agree its not super natural to deal with the php type system but once you learn it its pretty simple to keep things in order.
I see most messes arise when people mix types, mutate variables carelessly, or otherwise over leverage things they shouldnt (e.g. globals)
But these are hygiene problems, and all languages have these.
Ive seen garbage java, ive seen hairballed rust, ive seen pretty much any c, ive seen wanky golang and ive seen babel-typescri-rea-tsx
The only thing that really annoys me about php these days is the dollar signs.
That and the frameworks are all trash.
1. The meme where someone sits in a burning house or room and says "It's fine.".
2. "Sweet lemons". That is the sort of psychological "strategy" that is often applied and that seems to be used here: Things are bad, so lets talk them good. It all sounds like "Oh come on, it's not so bad!", but that is not the point. The point is, that compared with more developed languages, things are objectively worse with PHP and no one should have to deal with its issues.
There are issues in programming languages, which cannot be fixed, except for making far fetching design changes to the language itself, unless you include the required tools inside the language, for modifying the language itself. Those are called macros usually, and I am not talking about C preprocessor macros.
To fix a lot of the issues PHP would have to change to a degree, where it is no longer PHP and it does not include the required tools for changing the language itself. It requires a commitee, which is apparently unwillig to fix the language, or is so slow at it, that we still have PHP in its current form after "25 years of PHP".
As a Clojure developer, I see plenty of things that might be better in PHP in language design (making existing syntax more powerful instead of adding more syntax), implementation (make sure there are no memory leaks for example), stdlib (make one big incompatible release and make sure all functions have consistent naming & parameters & return values).
But today, in the age of PHP 7, frameworks and thousands of libraries, short requests that make memleaks insignificant, I think PHP is an awesome productive language. A language purist who loves elegance (like me) would not take a fancy of PHP, but the same goes for Go, C, C++, Lua and in some way also Vala, D. These languages are just highly practical hammers. Nothing to love, nothing to play with. But boy, these hammers are highly productive and in the right hands and appropriate situation, they are very hard to outcompete.
For some people, using PHP can be the best solution (Do you know C-like languages? Are libs you need in composer? For such a person PHP might be a way to get the result fast).
It happens on accident. All keys are converted to ints if they can be. So if you read a file that is called "123", it'll suddenly become an int key whereas all the rest will be strings. That's absolutely insane.
> Why do you want type hints?
The same reason anybody does. It is a contract and it makes your code more well-documented, more robust, and more correct. There's a reason that PHP has typehints and the consensus in all major, current, PHP projects is that they are good.
> Php has pthreads. They just arent needed that often.
Pthreads is garbage. Always has been. Never worked on servers. Is deprecated, finally: https://github.com/krakjoe/pthreads/issues/929 https://www.php.net/manual/en/intro.pthreads.php
> Async is being worked on You didnt mention it but immutable types are also being worked on.
PHP will be less awful when they're done. It's still awful today. I don't revel in PHP being bad. If it's good some day, I'll be happy.
> Everything people complain about php over tends to actually make its way into the language eventually.
25 years. 25 years and the language still sucks. Just use Java (or better yet, Kotlin).
> I dont know when you tried php, but I dont really think it was in earnest. It sounds like you had problems keeping your types straight.
I've been doing PHP dev for years now. Of course I had trouble keeping my types straight. PHP turns everything into a string whenever it can. Except sometimes it turns strings into ints for some unholy reason. Also, the type system (like Java's) sucks. It's not expressive at all and I can't even return a collection of a single type without resorting to language extensions.
> I agree its not super natural to deal with the php type system but once you learn it its pretty simple to keep things in order.
Not being natural is not the same thing as being broken. And being able to remember all of the gotchas doesn't make it simple.
> I see most messes arise when people mix types, mutate variables carelessly, or otherwise over leverage things they shouldnt (e.g. globals)
Agreed. So how do we avoid mutation? Use `clone`? Nope. It's shallow and everything is mutable by default. Overload `__clone()` on every class you write? Okay, but you better hope that your classes don't have fields that DON'T implement deep cloning...
> But these are hygiene problems, and all languages have these.
Bull. No language is perfect. But tell me, what's worse: 1 issue or 1,000 issues? Come on.
> Ive seen garbage java, ive seen hairballed rust, ive seen pretty much any c, ive seen wanky golang and ive seen babel-typescri-rea-tsx
See above. This is the most bottom-of-the-barrel excuse I keep reading over and over. PHP ENCOURAGES garbage code. Rust does not. Not even in the same ballpark. Not even playing the same GAME.
> The only thing that really annoys me about php these days is the dollar signs.
lol
— Ken Pier, Xerox PARC, Preface to The Unix Haters Handbook
Re; the mixed int/string key issue with filenames being the key - what issue did you witness having a mixed combo of types for the key cause?
Or was it just that the types were mixed and this was unnecessarily confusing?
Thanks
I think it’s important to distinguish between a language, and its environment and ecosystem. That’s where PHP shines. I wouldn’t choose PHP for my own projects, but with the tooling and frameworks available I actually don’t mind working on it for money.
Java: the amount of files and java-knowledge and xml files crap one has to go through... No thanks.. PHP might not be perfect ! But it's NOTHING like java.
Also, if you're talking about a single-file project, you can do that in Java, too, using plain old javac. It's not quite as simple as dropping a file on a server (but it's really damn close- first run javac, THEN plop the file on the server).
But you're fooling yourself if you think you don't have to do any setup to get a publicly facing PHP app to work. If you don't configure your Apache or Nginx or fiddle with your .htaccess junk, then you're not actually doing anything. So it's not fair to complain about "xml files crap" for Java and not discuss the equivalent for PHP, which is fiddling with php.ini and installing php_mod and configuring that in your Apache or whatever.
I am currently working on a Kotlin backend project and I haven't touched any XML. I've done plenty of Java/Kotlin and PHP.
A lot of the tooling can abstract you from the brunt of it.
Have you ever played around with Kotlin?
Never say never my friend, as someone who has used PHP in the past I prefer Java by far. The streams concept/interface they have in Java is really cool.
It’s much more like C than Java. And Java was in its infancy when PHP came out so it makes sense that it’s inspired more by C than Java.
Laravel et al read like java. Nobody wants that crap anymore. Everyones moving codebases back to more procedural styles with a good dose of functional leanings towards immutable values.
Could you give an example? Because I've never had any issues with it and find it very predictable.
> The fact that you can't typehint everywhere also sucks.
Type-hinting is being implemented and is already available in most places. But why you'd expect that in a dynamically typed language is beyond me.
> No generics sucks.
Again, dynamic language.
> No threads sucks.
pthreads has been considered stable since early 2014: https://pecl.php.net/package/pthreads
> Globals suck
Are you talking about "register_globals" which had its default setting changed to "off" 18 years ago and was completely removed 8 years ago: https://www.php.net/manual/en/security.globals.php ?
> But is that because PHP did anything useful, or because Apache and Nginx support PHP out of the box?
Do they? Last I checked you had to install and enable support for PHP just like anything else. Unless you're talking about bundles like MAMP, but then it doesn't really make much sense.
You may claim that you've used PHP in earnest, but I honestly find that a little hard to believe when seeing these claims. And I don't mean that I expect you to understand all the little edge-cases of type-coercion, but if you'd really needed threads I'm sure you'd have stumbled upon pthreads, and if you've been using globals, then you've been following some oooooold guides.
I'm still confused about the array keys though. I'm not sure I understand the example you gave in your other comment.
And I'm also curious which Apache and Nginx has PHP installed and enabled by default.
https://www.i-programmer.info/news/98-languages/11184-which-...
"The languages with the strongest positive coefficients - meaning associated with a greater number of defect fixes are C++, C, and Objective-C, also PHP and Python. On the other hand, Clojure, Haskell, Ruby and Scala all have significant negative coefficients implying that these languages are less likely than average to result in defect fixing commits."
BUT. Today's "best practices" for PHP are to use typehints everywhere. And there are language changes in the works to add MORE typing to PHP.
Okay, so don't? I think individual languages are better when they don't add every feature under the sun that happens to be popular in the moment. PHP doesn't need threads and it sure as hell doesn't need async. PHP multiprocessing works the old way just fine (fork).
> Today's "best practices" for PHP are to use typehints everywhere.
Yeah, and it's a result of people constantly bitching about PHP lacking features. It's really annoying because it gives credence to complaints like this, I really wish they would have just replied to the strict-types demands with "No, fuck off, this is a dynamic language."
If you must use PHP, I would strongly suggest you use it the way it was intended and stop trying to shoehorn other language features and paradigms into it, you will be much happier. If we simply treat PHP as a dynamically typed C, everything is so much easier.
To clarify, comments never affect running code in PHP, ever.
What's often done however is that tools like ORMs, or web frameworks offer a 'compile' step that parses these annotations (just like it's common in Java) and dumps a PHP file that maps things in the annotations into actual PHP code.
For example, you can use it in Symfony to wire routes to handling functions in controller classes; or in Doctrine to help the mapper wire Entity classes to database tables.
If you don't like the idea of preprocessing annotations, you can totally not use them and configure everything using external YAML/XML files.
I get the idea of a compile step, and that's totally fine. But these annotations are commented out. It's very icky to be using them for anything other than documentation -- which is what comments are for, after all.
Java's annotations are a bit different. Sure, the compiler does things with them -- the runtime does, too --, but they're syntactically part of the language. In PHP, they're kinda of not. Not yet, anyway.
The biggest difference between PHP and Java in my mind is that you start Java and pay the compile cost on server start, in PHP you pay the compile cost on every request, frameworks and language features increasingly hide this future cost in caches but caches are one of the two hardest things in computing and often act like pushing things under the carpet, why optimise the compile? It's under the carpet
As we move closer and closer to Java's model, we get further and further away from that quick PHP feedback loop of, make a change press f5 see the changes immediately and quickly
Which puts us further and further away from the kind of ideals that Bret Victor mentioned in his very good talk inventing on principle: https://youtu.be/PUv66718DII which to quote: "Creators need an immediate connection to what they're creating."
Inevitably this is coming and is already here but we should recognise what we've lost
The more languages the better IMHO though
I distinctly remember writing a project in PHP that allowed users to create custom reports and flows based on values returned from the data models, and for whatever reason we decided to use PHPDoc tags to determine what routines would be exposed to the public for use in these tools. We of course eventually updated this to use DB definitions instead because it was an asinine idea to need to parse a bundle of models and other files every time you needed to pull in definitions.
Yes it's perfectly fine to use PHP if it's a productive environment for you. Of course it's possible to write good software with it. Of course a skilled developer will manage to do great things with sub-standard tools. Many extremely popular websites were and even still are powered by PHP, that's undeniable.
But that doesn't mean that we should absolve PHP of all its many, many design errors over the years. There were for a long time many fundamental issues with PHP as a language that didn't exist with its peers. The language was not so much designed as it was cobbled together by amateurs starting from a half-backed templating engine.
I'm not saying that to hate on PHP, I just believe that it's important to learn from your mistakes if you don't want to end up reproducing them. It's important to acknowledge the many failings of PHP even if many of them are now ancient history.
This revisionist stance that there was never anything really wrong with PHP and it's just Lispers who hated on the language because it was popular and beginner-friendly and they didn't know what they were talking about is simply, factually, provably untrue.
This strikes me as a strawman. PHP spent years being a generally loathed language for reasons that at this point aren't really worth reiterating.
But, in an analog to Javascript, it has made progress, grown up and become a better language. One of the best? Like Javascript, no. But serviceable at worst.
I stopped earnest work in PHP ~ 5.7. I dabbled with HHVM, but eventually moved most backend/server code to Go and moved on with my life. But PHP 7+ has been a big step up, at least from my current vantage point.
This story is called "25 years of PHP" and the parent starts their comment with "I wrote a lot of PHP from 1999-2008". In this context I think it's fair to remind people of the many... controversial choices the PHP developers have made (or, maybe more accurately, stumbled upon) especially early in its history.
I certainly hope that most of these earlier flaws have been addressed, and I'm willing to believe that modern PHP can be a much better language to work with but that doesn't mean that we can say that criticism wasn't ever warranted. Lest we forget this is a language that once shipped a function called "mysql_real_escape_string" and saw nothing wrong with that and a tertiary statement whose precedence works backwards from any other language with a similar construct.
[1] https://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-st...
I also think that both JS and PHP get a lot of flak for maintaining backwards compat as far back as they do. You can run a lot of webapps (frontend and backend) from 10-20 years back in modern PHP and browsers which is pretty amazing. I'd like them to have a modern mode (like the proposed p++/<?php2020 and modules for JS) we should still acknowledge that maintaining compat that far back is not easy.
PHP did drop some stuff between 5 and 7, but all of it had been marked deprecated for some time prior (often years).
To be clear, this is what I was saying when I called upon it as an analog.
>My only real gripe with PHP is the annotation syntax.
This is a hugely underrated benefit of PHP overall, and arguably the one reason better designed languages won't replace it for web development purposes. You don't need a command line or SSH access or server management knowledge or many resources/A VPS or dedicated server or well, pretty much anything.
It's also why about 99% of fancier, more up to date alternatives to software like WordPress or Media Wiki or [various forum scripts here] don't catch on too. The older software can be installed/maintained by people who aren't very technical, whereas many attempted replacements require you to be a developer/server admin to understand the install process.
Anyone who truly wants to replace/be rid of PHP should come up with a language that works in much the same way.
It's not pretty but this allows shared hosting to exists. Those power big chunk of the content of the internet.
This is a really underappreciated aspect to development in general and web development in particular. There are (or at least were) an awful lot of "shared hosting" providers which are cheap, convenient, and run PHP and CGI only.
Yet I still have to define startsWith() and endsWith() any time I touch PHP code...
(More importantly, PHP is the one language I can never write from memory without referencing the manual for each and every function call because of how inconsistent it is. Eg Sometimes $haystack is the first parameter and sometimes it is $needle.)
It's a workaround to copy Java's annotations which IIRC also came from javadoc. PHP-8 is adding proper annotations as well. In general being able to add parseable meta information to your code can be quite useful.
That will change in PHP 8 with the introduction of attributes (https://wiki.php.net/rfc/attributes_v2).
I loved to hate PHP until I was forced to dig into it to help a friend set up a Wordpress site. And now I don't hate it any more. It does the job it was designed to do in a reasonably non-horrible way. I don't think I'd ever try to build a Facebook-scale app with it ;-), but as the BASIC of web site creation, it doesn't completely suck.
I started using PHP just before PHP 5 came around. And let me tell you - working with legacy code that used magic quotes or auto-globals is the reason I'm a die-hard strong type programmer today.
On the other hand, PHP didn't get in the way. It gave you a simple way to map a URL to a piece of code, and then let you respond to the request however you wanted - without "middleware" and "routers" - or "servlets". I sometimes miss that.
Communities should be kept responsible for setting quality standards or failing to do so.
PHP has been horrible at maintaining the core library. The core library is a guide for developers, as to what their code should look like. (Brian Goetz goes on a long talk about the fact that all of your code is an API, even if you don;t mean it to be)
That's why every time I chastise Scala developers and Martin Odersky for symbolic operator overloading. The guy talks at length about how it's wrong to abuse the symbolic operator overloading in creating unintuitive operators.... and then introduces :$#@%$%$%:;:/ operator to create a list.
Agree. The first time I ran into this, I was completely confused as to why my code wasn't running as expected. Then I noticed the strange formal structure of the comments, made changes there, and voila.
I don't understand why that feature wasn't implemented as decorators or some kind of function code. If anyone has any resources/thoughts on why this path was chosen, I would be interested in seeing them.
This has got to be one of the worst arguments (or rather, pieces of rhetoric) there is [0].
[0] - https://www.lesswrong.com/posts/dLJv2CoRCgeC2mPgj/the-fallac...
Detractors of PHP were pretty quiet when this first hit the front page. I think things might have stayed quiet without this first salvo being fired.
Don't check out Golang then...
https://dave.cheney.net/2018/01/08/gos-hidden-pragmas
https://dave.cheney.net/tag/build-constraints
https://blog.carlmjohnson.net/post/2016-11-27-how-to-use-go-...
Hey, think about it: in Python we have type annotations that are in code, not comments, and yet THEY DON'T AFFECT RUNNING CODE ! ;-)
> But it's not fair to attack a language over its inexperienced users.
I wrote PHP code in roughly the same period as you. Before a certain point, PHP actively promoted bad practices which was not helpful to the inexperienced users.
That's the error.
I worked for a shop in the past that had this problem in spades - huge ColdFusion and PHP ecommerce sites that were a gigantic ball of horrifying security and functionality failures, started by people who taught themselves how to program on the job because someone said "we should sell our stuff on the web".
I guess the world is probably net better for those sites existing, even as they are, but it feels like PHP could have done a better job of helping learners not shoot themselves so violently in the foot.
Academic journals, book publishers, Linux distributions do vetting.
Reputable journals, publishers, distros are more strict than non-reputable ones.
Universities do exams. Companies do interviews.
Why is it acceptable that some software communities have zero standards?
some of the function names make
me want to stab people
What would be an example? My only real gripe with PHP is
the annotation syntax
What do you mean? Afaik there is no "annotation syntax" in PHP. Could it be that you confuse what certain frameworks and IDEs do with PHP, the language?get: gettype get_class
str: str_ireplace str_pad str_repeat str_replace str_shuffle str_split str_word_count strcasecmp strchr strcmp strcoll strcspn
encode: base64_encode quoted_printable_encode session_encode rawurlencode urlencode gzencode
php: php_uname php_sapi_name php_logo_guid phpinfo phpcredits phpversion
htmlentites: htmlentities html_entity_decode
to: stream_copy_to_stream strtolower strtotime strtoupper unixtojd
2: bin2hex deg2rad hex2bin ip2long long2ip nl2br rad2deg
Of course it would've been nice if, at any time in the past 20 years, they'd gone back and standardized those function names (possibly also adding some kind of backwards-compatibility shim for people who absolutely cannot update their ancient codebase with global search-and-replace), regardless of whether the story is true.
Length as hash was indeed a thing in PHP/FI 2.
Second third to the reason is that PHP often takes names from underlying C libraries. strlen is strlen since that's the C name etc.
Third third reasoning is that early PHPade it easy to contribute. You had a need and a patch - a few minute Slater it is in. Nowadays there is more of a debate and vote before things are added (in my personal opinion too much emphasize on voting, but, well that's how things go, some day the process will be relaxed again ... and strengthend ... and relaxed)
Cleaning this up isn't trivial. There eis sooooo much code written already. There are sooo many tutorials, books, articles, magazines, videos and muscle memory making a change hard, even ignoring that for many things there is no single truth about what is best.
From time to time some modules might see replacements with more streamlined APIs (i.e. Maybe someday one figures out what a good and practical Unicode aware string library might be, which might replace the classic string mess) but those are multi year things.
Also, why is it array_reverse, but rsort? I dunno.
The mix of c like strpos, strstr and inconsistent parameter ordering (see array map and filter for example)
> What do you mean? Afaik there is no "annotation syntax" in PHP. Could it be that you confuse what certain frameworks and IDEs do with PHP, the language
If there's no official standard, but everyone follows a community standard, then that is the standard. Quit being pedantic.
Hopefully PHP 8's attributes work to fix the mess that is phpdoc being used for annotations.
Like a floppy-disk save icon, what helped one generation becomes obscure to the next and they obly see the flaws.
PHP8 annotations won't allow nested annotations so its only a partial solution.
So, all your work must be completely perfect and makes everyone happy?
It's easy to criticize but I don't get how people become so offensive with the wording.