What is PHP?
PHP is a language that runs many websites, including WordPress. A version number tells you how new it is. PHP 7.4 came out in November 2019.
Tip: PHP 7.4 is old and no longer gets security fixes. Newer versions work in a similar way and are safer. Use a newer one if your site allows it.
New features
- Typed properties. You can say what kind of value a variable must hold. A variable is a labelled box that stores a value. This catches mistakes early.
This says the box must hold a whole number.public int $age; - Arrow functions. They are a short way to write a small function.
This makes a tiny function that doubles a number.$double = fn($x) => $x * 2; - Null coalescing assignment. A short way to set a value only if it is empty.
This sets the name to Guest if it has no value.$name ??= 'Guest'; - Spread operator in arrays. You can merge lists with three dots.
- Preloading. The server can load code into memory once to save time.
Deprecations
Deprecated means "still works, but will be removed later". PHP 7.4 warned about a few things.
- Using curly braces to read parts of a text, like
$str{0}. - The
realtype and theis_real()function. - Some old ways to join text and arrays with
implode(). - Nested ternary operators without brackets.
Warnings show in your error log. Fix them before you upgrade to a newer PHP.
Speed
PHP 7 versions are much faster than PHP 5. Version 7.4 adds small gains. Preloading and better memory use help most. Your site may load a little quicker and use less memory.
How to switch the PHP version
- Back up your website first.
- Log in to cPanel.
- Find Select PHP Version or MultiPHP Manager.

- Choose your domain and pick the version.
- Save and test your site.
If the option is missing, open a support ticket.
Warning: Old plugins or themes may break on a different version. Test first, and keep your backup.
