Share your favorites!
the $, easier for me to look for variables. It also make PHP distinguishable from other lang
.
aka the string concatenation operator.
Every other language that shares an operator between addition, and string concatenation, feels so annoying to program to me.
Yeah I agree with this one. Using + in other languages feels strange to me now.

I typically reach for whatever templated strings feature exists though (like double quote strings in PHP or backtick strings in JS).
I strongly disagree. + feels very natural regarding string concatenation. . on the other hand is quite… unique, I’d say.

Also why would it annoy you? String concatenation and number addition do not mix, so it is ok to overload this operator for different types.
We also lost possibility to use dot . operator instead of -> as a property access operator, which is a shame. I know they both come from C, dot is just more concise and pleasing to (my) eyes.

Considering all this, I’d rather say that it was a mistake from the language design point of view to come up with a new operator instead of overloading an existing one.

Make a change, refresh and BAM it’s applied. No compile time, no build time.
I know most of us use a framework of some sort, and I myself am deep into a framework that uses preload, yaml configs and caching of all sorts that makes even a simple change in dev environment really slow, I just became so used to it that I don’t pay attention to the slowness anymore.

But sometimes making a change, refreshing the browser (or firing Postman) and seeing the result immediately feels good.
This. In my experience with C#, compilation time is pretty quick. But that stop/change/restart dance gets annoying.

The heredoc syntax introduced in 7.3 that allows you to have it indented. Big win for readability of templated strings. It’s not used that often, but when it is, it’s a great improvement.

I couldn’t really think of any other “underrated” features, cause I see most of the ones that come to mind basically all the time, with positive reactions, I guess.

Wanted to say this. I’ve never met any other php devs in my work who ever use it, not sure any of them even knew about it. I love it and use it all the time. Why would I want to do extra work to prepare data by hand or with multiple core function calls to make sure it doesn’t break the quotes when I can just use the right tools for the job and throw the data in? Screw escaping.

But what’s the use of heredoc at whole anyway? I forgot the last time I used it.
It only had some little application long ago when I needed an inline email template. But since I was introduced to Twig, it took all the responsibility for HTML rendering, both online or canned.

In all other cases double quotes are simpler to type and read.
I didn’t even know about this until now.
levenshtein

Wow. This is rad and I had no idea it existed.
array_column() is a great function, I do not know in any other scripting language I use (js and python).
For functions -> array_reduce since it pretty much lets you create any of the other other array_<foo’s> but is more expressible and for me at least more readable.

My coworkers hate the array_map/reduce/filter and are peer pressuring to use only foreach(). It makes me so sad 😭
The fact that arrays are copy-on-write.

Copy on write. It’s so embedded into our usage patterns now we don’t even think about it, but I don’t know any other mainstream language that does so much for you to keep your memory usage down. It’s not perfect, and you can still make memory-greedy apps, but things that in other languages you have to care about PHP let’s you mostly ignore 99% of the time.

Also, the most robust typing system of any interpreted language. That’s nothing to sneeze at.
The fact that it is an interpreted language that can almost behave like C#/Java (in its OOP concepts).

I haven’t seen any other interpreted language like that.
With enums (good chance of coming soon) and generics we will practically have the same capabilities in structuring code as a compiled language.
strtr()

The generator class in my opinion
The number of libraries it comes linked to or can be linked with (that is, the huge number of functions) and the number and variety of builtin functions Yeah it’s messy but still.

source