compatibility with PHP5.4+