add compatibility with older PHP versions

down to PHP 5.3.7