Added compatibility for PHP5.5+