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 […]