Your Ad Here
21st
September

Becoming PHP6 Compatible

You may also want to read the Unofficial PHP6 Changelog to find out what is changing in version 6.

PHP developers, like all developers, want their scripts to be as compatible as possible. Often, this involves looking into the past, to see if scripts are backwards-compatible. But, we sometimes have to look into the future - to see what is changing, and to understand what we need to do to become compatible.

PHP6 is the latest, yet unreleased version of PHP. It is still under development and won't be released for some time yet. Nonetheless, it is still important that we consider the changes we know about at the moment, and write scripts which are compatible.

If you want to make use of PHP6 when it comes, you're going to have to write your new scripts so they are compatible, and possibly change some of your existing scripts. To start making your scripts PHP6 compatible, I've compiled a list of tips to follow when scripting:

Don't use register_globals
In PHP6, support for register_globals will be no more. There will be no option to turn it on or off - it will not exist. This change should not affect you, as you shouldn't really use register_globals anyway. If you don't already know, register_globals puts $_REQUEST into the global scope, so you can access the variables just like any other variable. Instead, you should access inputted data like this:

$_GET['input'];
$_POST['input'];
$_REQUEST['input'];

Read more »