Your Ad Here
9th
December

Unofficial PHP6 Changelog

Note: The following list may contain some inaccuracies.

To the best of my knowledge, the following things are changing as of PHP6:

  • FILE_BINARY and FILE_TEXT constants available for use with filesystem functions.
  • register_globals will be gone.
  • magic_quotes will also disappear.
  • $HTTP_*_VARS has been removed, in favour for $_GET, $_POST, etc.
  • ereg() no longer available in core PHP6.
  • Initiating objects with the reference operator (& new Object()) will generate E_STRICT error.
  • E_STRICT error messages are included in E_ALL errors.
  • {} for string offsets no longer available.
  • [] un-deprecated for accessing characters in a string.

Read more »

27th
November

Even More Tips for faster PHP scripts

Following on from "Tips for faster PHP Scripts" and "More Tips for Faster PHP Scripts", I bring you Even More Tips for faster PHP Scripts.

Because I've already talked about the main, general, optimization tips, these ones will tend to be more specific and may not apply to everyone - nonetheless, it's worth a read in case you ever do come across these situations.

Here are tips 11-15:

11. is_numeric() vs. ctype_digit()
To see whether is_numeric() or ctype_digit() is the fastest method, I called each function 10,000,000 times. Here are the resuts:

is_numeric(): 9.943268 seconds
ctype_digit(): 11.801991 seconds
is_numeric() is 15.75% faster than ctype_digit()

It's worth using is_numeric() over ctype_digit() where it's appropriate to do so. Although a difference of 0.0000001858723 may seem small, it does all add up.
Read more »

25th
September

User Accounts with PHP and MySQL

Having a user accounts feature is something that I'd recommend to almost any website. It is one of the best ways to make visitors really feel part of your site. And, it's also gives you an idea of how many "valuable" users you have.

In this article, I'll be telling you how to create a user accounts feature, complete with a login form, registration form and "user area." To make the system, you'll need PHP and MySQL.

Read more »

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 »