PHP articles and tutorials ranging from new language features to using interesting packages.
PHP's array_reduce is a simple way to partition a set of data or return a single value. It is super powerful and worth spending time learning.
Now as of PHP 7.1, you can define the keys of your array that will be parsed when destructuring your arrays. Prior to PHP 7.1, you could only use arrays with numeric indexes. Now with this new addition, our lives just got easier.
Now in PHP 7.1+, you can set different visibility modifiers for each of your class constants. The available visibility modifiers consist of public, protected, and private.
So let’s face it, loops are a bit boring. So how can we mix it up? Let’s assume we have a case where we have a CSV file that we want to quickly parse.
The 5 basic principles for Object-Oriented Design, SOLID, were first created in an effort to improve maintainability in our code bases. SOLID is a mnemonic acronym that stands for each of the following principles: Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.