Replace code to allow usage against PHP 5.3