If you want to automate an admin colour scheme based on the #WordPress environment type, you can do it with this code. Good as a mu-plugin.
Here's how you can use PHP's spread operator to merge two arrays together. Technically this will be faster than array_merge too! Spreads also support anything implementing Traversable.
Speaking of alternative syntaxes, this is also perfectly okay in PHP.
You can also use curly braces in PHP switch statements. I honestly don't know why you'd want to do this though... Aside from the argument of readability, I haven't noticed any differences.
Here's how you can skip elements with array destructuring in PHP.
Did you know that in PHP 7.4, the numeric literal separator was added? This means you can separate numbers with an underscore. These two numbers are equal, but the second is much easier to parse. https://t.co/FM59NgCLyV
If you are asserting the content of a string that contains HTML tags in your tests, be sure to do *not* "escape" the string.
🤯TIL: PHP will automatically bind the $this context to closures:
TIL since php 8 the count function will throw a TypeError on invalid countable types. This definitely is a good thing! 🚀 I came across this while upgrading a legacy application from php 5.6 to php 8. https://t.co/TAafmOcnOy
🔥 Nice simple way to streamline compound expressions built right into the language... You may pass multiple arguments to `isset()`. Similarly it returns `true` only if all variables are declared and not `null`.