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.

PHP

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.

PHP

Speaking of alternative syntaxes, this is also perfectly okay in PHP.

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.

PHP

Here's how you can skip elements with array destructuring in PHP.

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

PHP

If you are asserting the content of a string that contains HTML tags in your tests, be sure to do *not* "escape" the string.

PHP

🤯TIL: PHP will automatically bind the $this context to closures:

PHP

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

PHP

More and more I’m thinking that your app (and database) should always be configured for UTC. - Convert dates to local using JavaScript in the browser for web users. - Use the `timezone()` method for scheduling tasks “Everything is in my timezone” until it isn’t

Laravel
PHP
JavaScript

🔥 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`.

PHP

The tweet will be reviewed and posted as soon as possible

{{ newSnippetForm.errors.url[0] }}

{{ newSnippetForm.errors.categories[0] }}