Four ways to count to four: PHP strings, iconv, mbstring and grapheme

Four ways to count to four: PHP strings, iconv, mbstring and grapheme

Four ways to count to four: PHP strings, iconv, mbstring and grapheme Nothing like starting the day with a nice café, in a Parisian café, pun intended. Now, when you ask PHP how long the word “Café” is, you get four answers from four families of functions. Two of them agree, one says 5, and […]

The Empty String in PHP: One Value, Too Many Jobs

The Empty String In PHP

The Empty String in PHP: One Value, Too Many Jobs The humble empty string “” is everywhere. It’s the quiet default, the silent failure signal or the silent success signal, the lazy cast, the natural accumulator. Behind the obvious simplicity of the empty string in PHP lies a surprising amount of overloaded meanings, which leads […]

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, […]