Refactoring Strings to Enums

Refactoring strings to enums

Refactoring Strings to Enums This article describes the journey of refactoring a not-so-old piece of code from using strings to using enumerations. Original Reasons When Exakat was started in 2014, enumerations were not even on the radar. Strings, and sometimes constants, were the obvious solution. As the original concept evolved quickly, strings were used everywhere, […]

All PHP 8.5 hash algorithms

All PHP hash algorithms

All PHP 8.5 hash algorithms Choosing the right hashing algorithm is difficult, balancing the need for security, speed, and reliability. PHP offers a almost 60 built-in hashing options, but not all are created equal : some are industry standards for cryptographic security, while others are optimized for lightning-fast non-cryptographic tasks like caching or checksums; some […]

PHP 8.5 new error messages

PHP 8.5 new error messages With a host of new features, PHP 8.5 also brings another 265 new error messages. These new error messages appears as PHP pays more attention to received arguments: their type, their values are reviewed more carefully before being used. And some error messages are prone to appear more often than […]

Understanding All Relations Between Classes, Interfaces, Traits, and Enums in PHP

Understanding Relationships Between Classes, Interfaces, Traits, and Enums in PHP Modern PHP offers four major code structures — classes, interfaces, traits, and enums — each with its own purpose and rules. But the real power of PHP comes from how these structures can interact with each other. This page gathers all relations between classes in […]

1-2-3 PHP operators

1-2-3 PHP operators I learnt my PHP on a European keyboard, and it was always a pain to use some strange symbols. When I moved to Canada, I quickly realized that the chosen symbols were actually very easily accessible on the keyboard: it was just my layout that was less practical. Then, I also realized […]

PHP parentheses usage

The Required, The Optional, The Useless, and The Weird: of In PHP, parentheses () aren’t just punctuation : they play different roles depending on where and how they’re used. Some are compulsory, others are optional, and a few are just useless clutter. And then, there’s the weird one: (cast). Let’s review all PHP parentheses usages […]