Fix for syntax error PHP versions

It seems that PHP 5.4 and 5.3 parse [] brackets differently so I change the code to work with both thanks to Dave Allen for helping me figure it out.