Working on PHP5.4 and above compatibility