__FILE__: The Magic Constant With Specific Usage

__FILE__: The Magic Constant With Specific Usage

 __FILE__: The Magic Constant With Specific Usage Every older PHP developer has meet __FILE__ early, usually while copy-pasting a WordPress plugin header from a tutorial written in 2009. There are lots of blogs posts documenting it: it is also quite famous outside the PHP universe. Nowadays, however useful is this magic constant, it seems it […]

Using a vector database with PHP

Using a vector database with PHP

Using a vector database with PHP PHP has roughly 80 array functions: eight – zero. array_map, array_walk, array_reduce,array_filter, array_each… wait, that last one was deprecated and removed in PHP 7.2. Or not? And some new functions came up in PHP 8.5, last november. The real problem is discoverability. You know the task, “find the first […]

5 usages of static keyword in PHP

5 usages of static keyword in PHP Static is a PHP keyword with many usages. It is almost universally used, though there are many variations of it. Let’s review all the five of them : static method static property static closure static variable static as a classname Static method The most common usage of static […]