fbpx
Default image

Luca Ferri

PHP tip: array_diff an array of objects

That’s tricky! Let’s assume we have two arrays like these: [crayon-5fc6ad1fad080538349255/] Looking at these few lines I would expect that those two arrays are different but if we compare them with php array_diff function they’re the same: [crayon-5fc6ad1fad088519807611/] This happens…

TWIG: include VS embed VS macro

There are various types of code reuse in Twig but, what are the differences between them? In this article we’ll explore the differences between include, embed and macro. First of all, some definitions from the documentation: The include statement includes…