tested it out, made some changes for PHP version 5.2.0

Signed-off-by: hughfuve <hughfuve@gmail.com>