implement arrayaccess
fix merge conflict
consistant variable names.
PHP 5.3 compatibility