Speed up ksort() ksort()is the PHP native function that sorts an array by its keys, while maintaining the relationship with the values. It has been in the language since the beginning (last millenium!), and yet, sometimes, it is interesting to ask again some old questions: can I speed up ksort()? Let’s see. ksort(), sorting by […]
Adoption levels of recent PHP features While browsing the PHP devsquad, I ran into this article that listed the top 10 powerful features of PHP. Beside the list, it made me wonder what are the adoption levels of recent PHP features, based on this list. Once in a while, I like to check such top […]
PHP Constructors and Inheritance When working in OOP PHP, understanding constructors is essential for manipulating objects. Constructors are magic methods that get invoked when an object is instantiated from a class. They typically handle the initialization of an object’s properties. These initialisations are split between parent and child classes, and the relationship between parent and […]
Difference Between Bitwise and Logical Operators in PHP The distinction between bitwise operators and logical operators operators is often overlooked and confused. They are often used one for another: it is true they have some overlapping domains of application, and yet, their functionality differ significantly. Here’s a breakdown of how these operators work: Logical Operators: […]
The 100 PHP functions that you have to know Here is the top 100 PHP functions : it is the list of the most often used PHP native functions. The functions are named, and ranked from 1 to 100. The other 4500 functions are not ranked here. The frequency column represents how often this function […]
All the ways to call a method in PHP There are many ways to call a method in PHP. Method calling is a very common task, and, although the most common syntax is the overwhelming majority, there are some niche syntaxes for specific usages. And some good old syntaxes too. Since they are scattered across […]
List of PHP native interfaces, and their implementation This is the list of PHP native interfaces, and their implementation as native classes. This was extracted from the PHP 8.3 source code, with Reflection. Each link leads to the documentation. It is based on a standard PHP 8.3 distribution, plus a few extensions. Interfaces that are […]
New PHP error messages in PHP 8.4 The upcoming PHP 8.4 is bringing new errors messages, and, also, removing some of them. The new messages originate from new features, deprecated ones, removed ones, and extra checks throughout the source code. Let’s review the new PHP error messages in PHP 8.4 and get our code ready […]
The Ultimate Guide to Navigating PHP Features Updates As PHP evolves, so do the language’s features, functionalities. And even the nuances in its behaviors. Yes, there are changed behaviors in PHP. They range from syntax changes to change in behavior of certain functions. And it can be overwhelming to keep track of how each new […]