Introduction
PHP has changed a lot over the last 20 years, but there are still many tutorials online which represent the old way of doing things. This guide will show you how to write modern PHP, and also how to migrate legacy code to modern standards.
I assume that you're already familiar with the basics of PHP, so I won't discuss topics like what a variable is, how to write and call a function etc. However, you might have learned PHP a long time ago, or be working with a legacy codebase that needs to be modernised.
PHP version
Apart from the chapters relating to modernising legacy code, this guide assumes that you are using a supported version of PHP, which is currently 8.1 or higher.