Backward compatibility for PHP5.3.*

Slight format change and created a function to contain the offending statements.