Are you ready for PHP 6?
Here’s an article from Linux Magazine showing you how to install a development snapshot version of the latest PHP 6 build on your system. They also go on to give an overview on what’s new in PHP 6 and some of the code you’ll have to change in your current source to get it working on PHP 6.
The good thing about PHP 6 is that by default all strings are treated as Unicode characters, unlike the earlier versions where a lot of the default functions in PHP used to break up unicode characters and essentially junked the data. UTF-8 is now the default encoding for many of the PHP 6 functions, so you don’t have to worry about your unicode data getting junked. In PHP 6 you have to watch out when you’re handling binary data, you’ll have to explicitly typecast your binary data or risk getting it junked because PHP 6 thinks of it as unicode
$binStr = (binary)$rawdata;
You can also declare the encoding of your PHP script by the following command:
Even your OO code where you were following the pre PHP 5.3 object models will not work here, since object model compatibility is removed. So your classes should be like this:
class newClass {
private $variable;
public function myMethod {
}
}
instead of the old notation in 4.3 which used to look like this:
class newClass {
var $variable;
function myMethod {
}
}
Read more on this topic at Linux Magazine: Get Ready for PHP 6
Image Credits: Narno via Flickr

