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 approach usually brings a bit of performance, by processing a list of arguments […]

PHP 8.0 named parameters and variadic

Named arguments and variadic in PHP 8 PHP 8.0 introduces the named arguments. This is an extension of the current positional syntax. Named arguments removes some of the limitations. It also modernizes the way methods are called with an arbitrary number of arguments, with the spread operator. Let’s see what is happening there. Quick review […]