List of PHP native interfaces, and their implementation

List of PHP native interfaces, and their implementation This is the list of PHP native interfaces, and their implementation as native classes. This was extracted from the PHP 8.3 source code, with Reflection. Each link leads to the documentation. It is based on a standard PHP 8.3 distribution, plus a few extensions. Interfaces that are […]

Move that foreach() inside the method

loops goes inside

Move that foreach() inside the method Several PHP functions work with single or multiple values. For example, array_merge(), which merges several arrays into one. Or, isset(), which checks simultaneously the existence of several variables. str_replace() and preg_replace_callback() also come to mind. This is a good place to move that foreach() inside the method. This approach […]

Const behavior in PHP 7

Const behavior in PHP 7 I always thought const behavior to be like class. Well, of course, beside the obvious differences, const and class were compile-time structures. They are complete at compilation, and could be op-coded and cached. This is unlike the slower define() function (for const), which requires PHP execution to be creating constants. This […]