Implementing Unicode, PHP 6, PHP 5 backward-compatiablity
Written on October 11, 2008 by Mike Gerwitz
To save myself the trouble later, I’ve decided to begin researching more into unicode in PHP, ensuring it is fully PHP 5 and PHP 6 compatible (at this point, unicode will still be limited to PHP 6, unless I figure out a speedy alternative).
The problem with unicode in PHP 5 is that…it’s a bit of work. I’d have to create a number of functions to handle unicode strings. But that would make the PHP 6 code messy and less efficient. PHP 6 converts the normal, core functions to handle unicode. So substr(), for example, will properly, handling unicode strings in PHP 6. So creating a separate function to use in place of the core functions so PHP 5 can have unicode support would be a poor decision. That function, in PHP 6, would have to forward straight back to the core function. Unnecessary overhead.
So, the language system will take a bit longer. I want to get this right the first time.
I’ll also be taking time to figure out the best way to design the project for PHP 6, with backwards-compatibility for PHP 5. I’m not talking “eh, it works” - I mean, work completely, with a few extra features for PHP 6 (one being unicode support). PHP 6 won’t be on web hosts for a while, so I need to ensure WebKernel runs flawlessly in both PHP 5.1 and PHP 6.
Posted in 




