Smooth migration from array to object I still need a smooth migration from array to object. There are a good number of arrays that are acting like objects in my source code. I have read (here, here) and written about the advantages of replacing arrays with objects in PHP. They are significant: better performance, less […]
PHP frameworks A curated list of 89 PHP frameworks. Contributing See CONTRIBUTING, to add or update a listing. PHP Framework list In alphabetical order. A Agavi : Agavi is a powerful, scalable PHP5 application framework that follows the MVC paradigm Aura Advanced tools for advanced applications. B Banshee : the secure PHP framework. B2evolution : […]
array_filter() versus Loop Condition Checks Optimizing your code for performance is important, especially when dealing with large arrays or complex data structures. One common dilemma developers face is whether to use array_filter() to preprocess an array before a loop or to check a condition inside the loop and skipping the unwanted values. In this blog […]
I have been working with a code base that uses a lot of arrays as hashes recently. This is a style that I am confortable with, as I do enjoy PHP arrays : flexible, powerful, versatile. Who don’t like them? Yet, I keep hearing that classes are more memory efficient than arrays. Yet, I still […]
Recently, I delved into a piece of code that involved a case-insensitive comparison of a character to a specific letter. The code, though straightforward, had room for optimization. Not being a fan of lengthy logical expressions, my curiosity led me to explore ways to make it more concise and potentially faster. What is the fastest […]
Building analysis to get ready for PHP 8.3 with static analysis With PHP 8.3 coming up next week, it is time to review our code bases with static analysis, and update everything that can be before the new version hits the production server. With a mixed bag of new features, changed behaviors and backward incompatible […]
PHP 8.2 features one year later Closing on one year after PHP 8.2 publication, and just before the publication of PHP 8.3, it is time to take a look at the PHP 8.2 features, one year later and how they are adopted in current code. We’ll take the list of ‘PHP Core’ features from the […]
Mastering the (array) Cast Operator in PHP: A Comprehensive Guide PHP provides various tools and features to manipulate data efficiently. One such feature is the (array) cast operator, which transform data into an array. In this blog post, we are mastering the (array)cast operator in PHP, focusing on its applications with simple scalars, objects, arrays, […]
Collateral behavior changes with PHP 8.0 switch() PHP 8.0 introduced a modernisation of the comparison between integers and strings. It changes the result of comparisons when a string is compared to an integer. Obviously, it includes comparing 0 and ” (empty string). This means that some comparisons were true in PHP 7, and are not […]
array_filter() versus Loop Condition Checks Optimizing your code for performance is important, especially when dealing with large arrays or complex data structures. One common dilemma developers face is whether to use array_filter() to preprocess an array before a loop or to check a condition inside the loop and skipping the unwanted values. In this blog […]