Replacing PHP Dynamic Class Properties
PHP 8.2 deprecates support for dynamic class properties. If you use dynamic properties, there are a few things you can do to remove them.
Qubits & Bytes
PHP is a widely-used web-focused programming language. It’s responsible for powering over 75% of all websites with a known server-side programming language, and is used by many popular frameworks such as WordPress and Magento/Adobe Commerce.
PHP 8.2 deprecates support for dynamic class properties. If you use dynamic properties, there are a few things you can do to remove them.
Traits are an often overlooked, but incredibly useful feature of PHP. This guide shows you how to use them to modularise your code.
PHP 8.1 added support for enums to PHP. This article looks at how to use them in your application.
PHP 8.1 introduces a new way to bind MySQLi statement parameters, which is much simpler than before. This article explains how to use it.
Many languages have pass-by-reference functionality, which can often speed up your code. Here's why this is not the case in PHP.
The splat operator offers a convenient way to unpack variables, and allow variable-length function parameters. This article will explain how to use it.
The PHP eval function seems rather useful. It's can also be incredibly dangerous. Here's why you should avoid it.